Composio enables agents to execute tasks that require the interaction of agents with the world outside via APIs, RPCs, Shells, Filemanagers, and Browser.
It also natively integrates with Julep, reducing the complexity of writing your own integrations!
Install & Set up Composio
## Set up Composiopipinstalljulepcomposio_julep
Log in to Composio & Authenticate with GitHub
composiologincomposioaddgithub
Preview
import osfrom julep import Clientfrom dotenv import load_dotenvimport jsonfrom composio_julep import Action, ComposioToolSetload_dotenv()api_key = os.environ["JULEP_API_KEY"]base_url = os.environ["JULEP_API_URL"]client =Client(api_key=api_key, base_url=base_url)toolset =ComposioToolSet()composio_tools = toolset.get_actions( actions=[Action.GITHUB_ACTIVITY_STAR_REPO_FOR_AUTHENTICATED_USER])agent = client.agents.create( name="Julius", about="GitHub Copilot Personified", model="gpt-4o", tools=composio_tools,)session = client.sessions.create( agent_id=agent.id, situation="You are a GitHub Copilot Agent. Follow instructions as specified. Use GitHub tools when needed.",)user_msg ="Hey. Can you star all julep-ai/julep and SamparkAI/composio for me?"response = client.sessions.chat( session_id=session.id, messages=[ {"role": "user","content": user_msg, } ], recall=True, remember=True,)output = toolset.handle_tool_calls(client, session.id, response)
Here, we create an agent and pass composio_tools instead of writing our tool spec.
agent = client.agents.create( name="Julius", about="GitHub Copilot Personified", model="gpt-4o", tools=composio_tools,)session = client.sessions.create( agent_id=agent.id, situation="You are a GitHub Copilot Agent. Follow instructions as specified. Use GitHub tools when needed.",)user_msg ="Hey. Can you star all julep-ai/julep and SamparkAI/composio for me?"response = client.sessions.chat( session_id=session.id, messages=[ {"role": "user","content": user_msg, } ], recall=True, remember=True,)
Handle a Tool Call
Composio offers a nifty handle_tool_calls function which calls your authenticated tools if that's what the agent has returned.