Skip to content

Commit

Permalink
nicer way of collecting the tools
Browse files Browse the repository at this point in the history
  • Loading branch information
ynvygy committed Jan 21, 2025
1 parent 4d45071 commit 55b1aba
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/agents/react_agent/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@
}
)

gmail = composio_toolset.get_tools(apps=[App.GMAIL])
calendar = composio_toolset.get_tools(apps=[App.GOOGLECALENDAR])
linear = composio_toolset.get_tools(apps=[App.LINEAR])
trello = composio_toolset.get_tools(apps=[App.TRELLO])
twitter = composio_toolset.get_tools(apps=[App.TWITTER])
apps = [
App.GMAIL,
App.GOOGLECALENDAR,
App.LINEAR,
App.TRELLO,
App.TWITTER
]

# for extracting the tools and flattening the list afterwards
tools = [composio_toolset.get_tools(apps=[app]) for app in apps]
combined_tools = [tool for sublist in tools for tool in sublist]
# pdb.set_trace()

async def search(
Expand All @@ -48,4 +54,5 @@ async def search(


# Combine the search tool with Composio tools using spread operator
TOOLS: List[Callable[..., Any]] = [search, *gmail, *calendar, *linear, *trello, *twitter]
TOOLS: List[Callable[..., Any]] = [search, *combined_tools]
pdb.set_trace()

0 comments on commit 55b1aba

Please sign in to comment.