Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Integrate Composio with LiteLLM and seamlessly interact with external apps
Install Packages
pip install composio_openai litellm
Import Libraries, Initialize ComposioToolSet & Create Router
from composio_openai import ComposioToolSet, App from litellm.router import Router toolset = ComposioToolSet() router = Router( model_list=[ { "model_name": "anthropic/claude-3-5", "litellm_params": { "model": "claude-3-opus-20240229", "api_key": "<your-anthropic-api-key>", }, } ] )
Connect Your GitHub Account
composio login composio add github
COMPOSIO_API_KEY
OPENAI_API_KEY
Get All Github Tools
tools = toolset.get_tools(apps=[App.GITHUB])
Configure Router
response = router.completion( model="anthropic/claude-3-5", messages=[ {"role": "user", "content": "Star the repository composiohq/composio on github"}, ], tools=tools, tool_choice="auto", )
Execute Tool Calls
result = toolset.handle_tool_calls(response=response) print(result)
Was this page helpful?