[Solved โ ] Running Composio locally? Error when trying to start
I get this error:

15 Replies
subsequent-cyanOPโข6mo ago
Trying out Composio, but when i try to run this simple test i get error.
Any clue? Im trying to fetch my emails through composio
continuing-cyanโข6mo ago
Hey @Em , this is just a warning which should not cause any issue in your case. Is this the complete code?
subsequent-cyanOPโข6mo ago
yeah
oh im dumb man
subsequent-cyanOPโข6mo ago

subsequent-cyanOPโข6mo ago
tryign to do this
and i feel like im missing something
my output looks like this right now
continuing-cyanโข6mo ago
Oh okay - this makes sense, there are two things to note here
1. Basically the code snippet above only allows you to get composio tools for "Gmail fetch emails" actions - just like in the output you sent above. You need to plug it into your agentic framework - which will allow your agent to decide and call this action to fetch emails.
continuing-cyanโข6mo ago
Check this langchain js e2e example for reference, https://github.com/ComposioHQ/composio/blob/master/js/examples/langchain/demo.mjs
GitHub
composio/js/examples/langchain/demo.mjs at master ยท ComposioHQ/comp...
Composio equip's your AI agents & LLMs with 100+ high-quality integrations via function calling - ComposioHQ/composio
continuing-cyanโข6mo ago
2. Also remove the second argument from
toolset.getTools
. It is there to filter your users with tags but in your case since you are just trying it out - for now you can remove it. After this your line 18 should look like this
subsequent-cyanOPโข6mo ago
ok
@Utkarsh i did some updates
it seems to work
@Utkarsh do you know how i change it so that my emails are limited to the past 24 hours? ๐ค
continuing-cyanโข6mo ago
yes, although I haven't tried it myself - gmail search queries support good advanced filters. you can try mentioning it explicitly in your agentExecutorInput to use it. Something like this should work
Check this doc for more detail on gmail query filters - https://support.google.com/mail/answer/7190?hl=en
Refine searches in Gmail - Computer - Gmail Help
Want to get more out of Google apps at work or school?
subsequent-cyanOPโข6mo ago
Oh. Composio is a lot more powerful than i though then haha
@Utkarsh thanks a lot ๐
is it possible to do two actions in one command? forexample if i add a label to the email it reads?
this is an updated version
continuing-cyanโข6mo ago
Yes, this is totally possible with same code you sent above but would require you to modify your prompt to be very specific. To increase the accuracy, I'd actually recommend creating separate sepcific agents instead of single agent for this
1. The first agents only fetches the latest emails and removes all the unecessary info. Make sure to mention to also include the messageId in the final output (this will be needed by second agent when it is adding labels)
2. The second agent adds labels to these emails
You can simply pass the output of the first agent to the second output as the task. Something like
Add label to all these emails: ${firstAgentOutput}
optimistic-goldโข5mo ago
Hey @Em, is your issue resolved ๐ ??
subsequent-cyanOPโข5mo ago
Yes ๐
optimistic-goldโข5mo ago
Awesome @Em, lemme know if you need any other help, till then keep exploring composio ๐