Star A Repository on Github

In this example, we will use LiteLLM to star a repository on Github using Composio Tools

1

Install Packages

Python
 pip install composio_openai litellm
2

Import Libraries, Initialize ComposioToolSet & Create Router

Python
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>",
            },
        }
    ]
)
3

Get All Github Tools

You can get all the tools for a given app as shown below, but you can get specific actions and filter actions using usecase & tags. Learn more here

4

Configure Router

Python
response = router.completion(
    model="anthropic/claude-3-5",
    messages=[
        {"role": "user", "content": "Star the repository composiohq/composio on github"},
    ],
    tools=tools,
    tool_choice="auto",
)
5

Execute Tool Calls

Python
result = toolset.handle_tool_calls(response=response)
print(result)