Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 03:37 UTC
| 1 | import asyncio |
| 2 | |
| 3 | import dotenv |
| 4 | from composio_llamaindex import LlamaIndexProvider |
| 5 | from llama_index.core.agent.workflow import FunctionAgent |
| 6 | from llama_index.llms.openai import OpenAI |
| 7 | |
| 8 | from composio import Composio |
| 9 | |
| 10 | # Load environment variables from .env |
| 11 | dotenv.load_dotenv() |
| 12 | |
| 13 | # Setup client |
| 14 | llm = OpenAI(model="gpt-5") |
| 15 | composio = Composio(provider=LlamaIndexProvider()) |
| 16 | |
| 17 | # Get All the tools |
| 18 | tools = composio.tools.get( |
| 19 | user_id="default", |
| 20 | tools=["GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER"], |
| 21 | ) |
| 22 | |
| 23 | workflow = FunctionAgent( |
| 24 | tools=tools, |
| 25 | llm=llm, |
| 26 | system_prompt="You are an agent that perform github actions.", |
| 27 | ) |
| 28 | |
| 29 | |
| 30 | async def main(): |
| 31 | result = await workflow.run( |
| 32 | user_msg="Hello! I would like to star a repo composiohq/composio on GitHub" |
| 33 | ) |
| 34 | print(result) |
| 35 | |
| 36 | |
| 37 | if __name__ == "__main__": |
| 38 | asyncio.run(main()) |