Star A Repository on GitHub

In this example, we will use Letta Agent to star a repository on GitHub using Composio Tools

1

Install Packages

Python
pip install composio_langchain letta
2

Import Libraries & Configure Client

Python
from letta import EmbeddingConfig, LLMConfig, create_client
from composio_langchain import Action, ComposioToolSet

client = create_client()

# set automatic defaults for LLM/embedding config
client.set_default_llm_config(LLMConfig.default_config(model_name="gpt-4"))
client.set_default_embedding_config(EmbeddingConfig.default_config(model_name="text-embedding-ada-002"))
3

Connect Your GitHub Account

You need to have an active GitHub Integration. Learn how to do this here

Don’t forget to set your COMPOSIO_API_KEY and OPENAI_API_KEY in your environment variables.

4

Add GitHub action to Client

You can get all the tools for a given app or specific actions as shown below. Learn more here

5

Execute the Agent

Python
response = client.send_message(agent_id=agent_state.id, role="user", message="Star the repo composiohq/composio")
print(response)