Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion end-to-end-use-cases/whatsapp_llama_4_bot/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
distro==1.9.0
dotenv==0.9.9
eval_type_backport==0.2.2
exceptiongroup==1.2.2
fastapi==0.115.12
Expand Down
8 changes: 4 additions & 4 deletions end-to-end-use-cases/whatsapp_llama_4_bot/webhook_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ async def send_message_async(user_phone: str, message: str):
async def send_audio_message(to: str, file_path: str):
url = f"https://graph.facebook.com/v20.0/{PHONE_NUMBER_ID}/media"
with open(file_path, "rb") as f:
files = { "file": ("reply.mp3", open(file_path, "rb"), "audio/mpeg")}
files = { "file": ("reply.mp3", f, "audio/mpeg")}
params = {
"messaging_product": "whatsapp",
"type": "audio",
"access_token": ACCESS_TOKEN
"access_token": META_ACCESS_TOKEN
}
response = requests.post(url, params=params, files=files)

Expand All @@ -69,7 +69,7 @@ async def send_audio_message(to: str, file_path: str):
"audio": {"id": media_id}
}
headers = {
"Authorization": f"Bearer {ACCESS_TOKEN}",
"Authorization": f"Bearer {META_ACCESS_TOKEN}",
"Content-Type": "application/json"
}
requests.post(WHATSAPP_API_URL, headers=headers, json=payload)
Expand All @@ -96,7 +96,7 @@ async def llm_reply_to_text_v2(user_input: str, user_phone: str, media_id: str =
}

async with httpx.AsyncClient() as client:
response = await client.post("https://df00-171-60-176-142.ngrok-free.app/llm-response", json=json_data, headers=headers,timeout=60)
response = await client.post(f"{BASE_URL}/llm-response", json=json_data, headers=headers,timeout=60)
response_data = response.json()
# print(response_data)
if response.status_code == 200 and response_data['error'] == None:
Expand Down