Skip to content
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

feat: added plugin-twilio this can send message using sms or whatsapp #1822

Closed
wants to merge 24 commits into from

Conversation

juanc07
Copy link
Contributor

@juanc07 juanc07 commented Jan 4, 2025

Relates to

Risks

Background

What does this PR do?

this will add a twilio api implemenation for send SMS or WhatsApp Message

What kind of change is this? this is a new plugin so this will be addition to current repo

this is none breaking, all possible errors are catch

i saw Shaw post this in X with reward so i did this for that reward, i really need money :)

Documentation changes needed?

it need some small changes you need to update Agent package.json to include plugin-twilio, then wire it in agent for plugin initialization and then pnpm install and pnpm build just to make sure

Testing

for testing you just need to tell the AI Agent the exact command format, please check the Usage Sample

Usage Sample

The message that you want to send must be inside a Single Quote or double quotes

Example 1:
Please send sms to [phone number], and my message is '[your message here]'
Please send whats app message to [phone number], and my message is '[your message here]'

Example 2:
Please send sms to [phone number], and my message is "[your message here]"
Please send whats app message to [phone number], and my message is "[your message here]"

Where should a reviewer start?

inside the plugin-twilio to make sure i follow the standards

Detailed testing steps

add this to .env file and fill in the details

Twilio Part

TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_PHONE_NUMBER=
TWILIO_WHATSAPP_PHONE_NUMBER=

then follow this steps

How to use

  1. create your .env file , if you don't have it yet and then populate it with the information above, make sure to fill in all information
  2. Add this project into your eliza os project under packages
  3. using terminal go inside plugin-twilio then type pnpm install twilio
  4. go inside your agent folder update the package.json add this "@elizaos/plugin-twilio": "workspace:*"
  5. add this inside your Agent index.ts import { twilioPlugin } from "@elizaos/plugin-twilio";
  6. Add twilioPlugin in Agent Runtime still inside Agent index.ts
  7. pnpm install
  8. pnpm build
  9. pmpn start --character="characters/nameofyouragentcharacterfile.character.json"

#Note: Make sure you have the following:

  1. Verified Twilio developer account
  2. Verified Twilio phone number
  3. Verified Twilio Whatspapp enabled phone number
  4. have enough credits but they provide free small credits when your account is new

visit twilio: https://www.twilio.com
twilio quick start guides: https://www.twilio.com/docs/messaging/quickstart
twilio documentation: https://www.twilio.com/docs/messaging
Free Trial Account: https://www.twilio.com/docs/messaging/guides/how-to-use-your-free-trial-account

For WhatsApp guides follow the link below you need to have a separate twilio whatsapp enabled phone number

https://www.twilio.com/docs/whatsapp
https://www.twilio.com/docs/whatsapp/quickstart/node
https://www.twilio.com/docs/whatsapp/getting-started#registering-a-whatsapp-sender
https://www.twilio.com/docs/verify/whatsapp

#Some Other Whats App Info that you might need
https://www.twilio.com/docs/whatsapp

#Twilio Phone Number guidelines
https://www.twilio.com/en-us/guidelines

Clarification this project is intended to be use/place inside elizaos project packages, this can't work alone

Sample implementation can be found here

https://github.com/juanc07/AgentSoulSpark

logs-twilio-send-sms
Screenshot_20250103_141851_Messages

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @juanc07! Welcome to the ai16z community. Thanks for submitting your first pull request; your efforts are helping us accelerate towards AGI. We'll review it shortly. You are now a ai16z contributor!

@odilitime odilitime changed the base branch from main to develop January 4, 2025 19:30
@odilitime odilitime changed the title added plugin-twilio this can send message using sms or whatsapp feat: added plugin-twilio this can send message using sms or whatsapp Jan 4, 2025
@odilitime odilitime added Needs Testing Plugin_new Mark PRs that are a new plugin labels Jan 4, 2025
@hellopleasures
Copy link
Contributor

ph represent, this is nice, salamat juan for this!!!

@juanc07
Copy link
Contributor Author

juanc07 commented Jan 5, 2025 via email

@juanc07
Copy link
Contributor Author

juanc07 commented Jan 5, 2025

ph represent, this is nice, salamat juan for this!!!

thanks but not approved yet, hahaha!

@juanc07
Copy link
Contributor Author

juanc07 commented Jan 5, 2025

suddenly i got integration test issue, but the error is not related to plugin-twilio here is the log "packages/plugin-node postinstall: throw new ERR_MODULE_NOT_FOUND(
packages/plugin-node postinstall: ^
packages/plugin-node postinstall: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/runner/work/eliza/eliza/packages/plugin-node/node_modules/@elizaos/core/dist/index.js' imported from /home/runner/work/eliza/eliza/packages/plugin-node/scripts/postinstall.js"

@juanc07
Copy link
Contributor Author

juanc07 commented Jan 5, 2025

BTW my PR is behind the develop branch , should i do the rebase or the moderator or admin only?

@juanc07
Copy link
Contributor Author

juanc07 commented Jan 5, 2025

i tried all that i can do but it seems some where in the repo the plugin-node is link or pointing to this directory "/home/runner/work/eliza/eliza/packages" so for me it seems like a local machine directory but the weird thing is i can't find it in the project. the whole error is "packages/plugin-node postinstall: throw new ERR_MODULE_NOT_FOUND(
packages/plugin-node postinstall: ^
packages/plugin-node postinstall: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/runner/work/eliza/eliza/packages/plugin-node/node_modules/@elizaos/core/dist/index.js' imported from /home/runner/work/eliza/eliza/packages/plugin-node/scripts/postinstall.js"

@juanc07
Copy link
Contributor Author

juanc07 commented Jan 5, 2025

the issue about the integration test is now fix, thank you @odilitime

@juanc07
Copy link
Contributor Author

juanc07 commented Jan 6, 2025

after merging with new changes from develop branch i got issues and error in integration test again "Error: ...1816_a2665c1acc2b05267414f68f617d222f npm-install: src/utils/root-ca.ts(4330,14): error TS2742: The inferred type of 'ROOT_CAS' cannot be named without a reference to '.bin/store/v3/tmp/_tmp_1816_a2665c1acc2b05267414f68f617d222f/node_modules/@peculiar/x509'. This is likely not portable. A type annotation is necessary.
...1816_a2665c1acc2b05267414f68f617d222f npm-install: npm error code 1
...1816_a2665c1acc2b05267414f68f617d222f npm-install: npm error path /home/runner/setup-pnpm/node_modules/.bin/store/v3/tmp/_tmp_1816_a2665c1acc2b05267414f68f617d222f
...1816_a2665c1acc2b05267414f68f617d222f npm-install: npm error command failed
...1816_a2665c1acc2b05267414f68f617d222f npm-install: npm error command sh -c npm run build
...1816_a2665c1acc2b05267414f68f617d222f npm-install: npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2025-01-06T01_18_30_870Z-debug-0.log
...1816_a2665c1acc2b05267414f68f617d222f npm-install: Failed"

@hellopleasures
Copy link
Contributor

We have all the same error, maybe the error is on the develop branch.

@juanc07
Copy link
Contributor Author

juanc07 commented Jan 7, 2025

integration test is working again after merging with latest develop branch

@Freytes
Copy link
Collaborator

Freytes commented Jan 7, 2025

The workflow should be the end user can text texts or call the number and gets the agent. The voice of the agent should use Elevenlabs, if at all possible

Copy link
Contributor

github-actions bot commented Feb 6, 2025

This pull request has been automatically marked as stale due to 30 days of inactivity.
If no further activity occurs within 7 days, it will be closed automatically. Please take action if this pull request is still relevant.

Copy link
Contributor

coderabbitai bot commented Feb 6, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@odilitime
Copy link
Collaborator

Hello,

We are changing our plugin development strategy to be more scalable. We have moved the plugins out into their own repos and we're looking for people to either maintain those or own them on their own Github.

If you'd like to be a maintainer, file an issue in the plugin repo and join our Discord https://discord.gg/elizaos to coordinate.

If you'd like to control the plugin on your own Github, please add an issue to the plugin repo pointing to your repo, and add a modification to the registry. Submit a PR to edit the registry here: https://github.com/elizaos-plugins/registry

Closing this PR for now. Let us know if you have any questions.

@odilitime odilitime closed this Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Testing no-pr-activity Plugin_new Mark PRs that are a new plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants