-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whatsapp integration #2335
base: main
Are you sure you want to change the base?
Whatsapp integration #2335
Conversation
libs/agno/agno/tools/whatsapp.py
Outdated
self.register(self.send_text_message_sync) | ||
self.register(self.send_template_message_sync) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about async? Maybe have a async_mode:bool
attribute at the top? We don't really build async endpoints yet, but that could be a good pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
libs/agno/agno/tools/whatsapp.py
Outdated
response.raise_for_status() | ||
return response.json() | ||
|
||
def send_text_message_sync(self, recipient: Optional[str] = None, text: str = "", preview_url: bool = False) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make text the first attribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
- Clarify ngrok setup instructions as development testing only - Add missing environment variable for WhatsApp recipient phone number - Regenerate requirements.txt with updated dependencies - Minor formatting and clarity improvements in documentation
…ok domain details - Change environment configuration from `.env` to `.envrc` for better environment variable management - Add instructions for using a static ngrok domain - Remove duplicate `WHATSAPP_WEBHOOK_URL` environment variable - Improve documentation clarity for webhook and ngrok setup
- Remove verbose logging in webhook verification and server startup - Remove dotenv loading from WhatsApp tools - Minor formatting improvements in README and code
- Correct duplicate environment variable checks for access token, phone number ID, recipient, and version - Ensure consistent fallback to specific WhatsApp-prefixed environment variables
- Rename `whatsapp_chat_agent.py` to `app.py` - Update README to reflect the new script name in startup instructions
- Swap order of `recipient` and `text` parameters for better readability - Update method docstring to match new parameter order
- Enhance debugging by logging request and response details - Log URL, headers, request data, status code, response headers, and response body - Use json.dumps for better readability of logged data
- Introduce `async_mode` parameter to enable async message sending methods - Implement `send_text_message_async` and `send_template_message_async` methods - Update toolkit initialization to conditionally register sync or async methods - Enhance configuration logging to include async mode status
name="whatsapp", | ||
tools=[WhatsAppTools()], | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a simple chat example as well?
- Replaced YFinanceTools with DuckDuckGoTools for improved search capabilities. - Updated agent description to reflect the new functionality and interaction style. - Removed duplicate webhook URL export from README for clarity.
- Revised README to reflect the new AI agent functionality and improved setup instructions. - Added detailed steps for obtaining WhatsApp credentials and configuring the environment. - Enhanced error handling and troubleshooting sections for better user guidance. - Updated `whatsapp_tools.py` to include links for easier navigation and clarified environment variable setup.
Description
Fixes # (issue)
Type of change
Please check the options that are relevant:
Checklist
./scripts/format.sh
and./scripts/validate.sh
to ensure code is formatted and linted.Additional Notes
Include any deployment notes, performance implications, security considerations, or other relevant information (e.g., screenshots or logs if applicable).