python/providers/openai_agents/README.md
This package integrates the OpenAI Agents framework with Composio, allowing you to use Composio's rich set of tools with the OpenAI Agents framework.
pip install composio_openai_agents
import asyncio
import dotenv
from agents import Agent, Runner
from composio_openai_agents import Action, ComposioToolSet
# Load environment variables from .env
dotenv.load_dotenv()
# Initialize Composio toolset
composio_toolset = ComposioToolSet()
# Get all the tools
tools = composio_toolset.get_tools(actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER])
# Create an agent with the tools
agent = Agent(
name="GitHub Agent",
instructions="You are a helpful assistant that helps users with GitHub tasks.",
tools=tools,
)
# Run the agent
async def main():
result = await Runner.run(agent, "Star the repository composiohq/composio on GitHub")
print(result.final_output)
asyncio.run(main())
Apache 2.0