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

Add Composio integration to the third party tools #88

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

cagnusmarlsen
Copy link

This PR adds notebooks to demonstrate how Composio can be used to create integrations and connect LLMs and agents to external tools.

Copy link

socket-security bot commented Aug 14, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@langchain/[email protected] Transitive: environment, filesystem, network, shell +50 43.6 MB basproul
npm/@langchain/[email protected] None +3 1.12 MB basproul
npm/[email protected] environment, network Transitive: eval, filesystem, shell, unsafe +184 135 MB sampark_inc

View full report↗︎

Copy link

socket-security bot commented Aug 14, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Install scripts npm/[email protected]
  • Install script: install
  • Source: node install.js
⚠︎

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@sophiamyang
Copy link
Collaborator

Hi @cagnusmarlsen, thanks so much for the PR! There seems to be a Socket Security issue. Could you kindly take a look? Thanks!

@cagnusmarlsen
Copy link
Author

Hi @sophiamyang, I've updated the code and all checks are passing now. The script in ssh2 that triggers this warning just tries to bind to OpenSSL, should not be a problem according to me. Thanks for taking a look at this!

@sophiamyang
Copy link
Collaborator

Hi @cagnusmarlsen, thanks so much for the PR! We'd like to publish your cookbook soon!

One minor thing:
I was trying to run mail-agent.ipynb in colab. I think the command line instructions need a "!" in front to be able to run. Could you help check and make sure it can run in Colab? Thanks!

@cagnusmarlsen
Copy link
Author

Hey @sophiamyang, yeah, I missed the "!" in front of the commands! I've fixed it and it should run fine on Colab now.

@sophiamyang
Copy link
Collaborator

Hi @cagnusmarlsen I love your cookbook! However, I'm not sure how the listener work exactly. I suppose this will see new email and try to respond? However, when I get new email, I don't see anything here. Could you help me understand or point me to the right direction? Thank you so much!
image

@Prat-0
Copy link

Prat-0 commented Dec 7, 2024

Hey @sophiamyang, I'm Prathit from Composio. Happy to help you figure it out.

the trigger listens until a new email is received, as soon as it is received it goes into the on_new_gmail_message function and executes the agent that responds to it with tool calling. The same code is working for me on Colab. Did you run the composio login and enable trigger commands and complete the authentication flows?

@sophiamyang
Copy link
Collaborator

Hi @Prat-0, thanks for checking! I do see the new received email now with the info shown like below. However I got an error Error: 'tuple' object has no attribute 'get'. How should I deal with this error? And does it suppose to reply the email in the same listener.listen() cell? Can I give inputs to the email response? Thanks!

INFO:composio.utils.shared:Received trigger event with trigger ID: 07a56184-b2a6-4185-8f0b-2b337b6216bf and trigger name: GMAIL_NEW_GMAIL_MESSAGE
data received appName='gmail' payload={'threadId': '193a320272ccedfc', 'messageId': '193a320272ccedfc', 'messageTimestamp': '2024-12-07T21:56:16Z', 'labelIds': ['UNREAD', 'IMPORTANT', 'CATEGORY_PERSONAL', 'INBOX'], 'preview': {'subject': 'dinner tomorrow night?', 'body': 'would dinner tomorrow night work for you?'}, 'messageText': 'would dinner tomorrow night work for you?\r\n', 'attachmentList': [], 'subject': 'dinner tomorrow night?', 'sender': 'Sophia Yang  ... 

@sophiamyang
Copy link
Collaborator

sophiamyang commented Dec 8, 2024

Hi @Prat-0 @cagnusmarlsen , thanks for updating. I'm running the notebook mail-agent.ipynb in colab and still get the error Error: tuple indices must be integers or slices, not str . Really want to see it work and merge the PR. Appreciate your help!

@cagnusmarlsen
Copy link
Author

Hi @sophiamyang, should work fine for you now. Thanks!

@sohamganatra
Copy link

sohamganatra commented Dec 8, 2024

Hey @sophiamyang , Composio founder here. Give me some time and let me confirm the submission end to end and once it works, I will also try to share a loom video of me running the complete code.

sorry about the trouble.

@sophiamyang
Copy link
Collaborator

Thanks @cagnusmarlsen for the updates! However I got a 404 here:
image

I'm pretty sure my Mistral API is correct bc I can call it with our API:

image

Do you know what could be the issue? Thanks!

@sophiamyang
Copy link
Collaborator

Thanks so much @sohamganatra! A video would be most amazing! Love composio and this use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants