@devries-cameron20 / composio-1 / commits / 40fd71e4d
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

docs: Update LlamaIndex provider page with Steps pattern

Standardize to Steps pattern with persistent language tabs, API key callout, consistent email task, gpt-5.2 model. Remove dotenv imports and system_prompt boilerplate. Fix TS result access (result.data.result). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Sushmithamallesh committed Feb 17, 2026 at 15:56 UTC 40fd71e4d114407760a348fa9a84d0eda59089d7
1 file changed +37 -31
docs/content/docs/providers/llamaindex.mdx
+37 -31
@@ -1,17 +1,19 @@
1 ---
2 title: LlamaIndex
3 description: Build an agent with LlamaIndex and enable it to use 800+ tools with Composio.
4 -keywords: [workflow, function agent]
4 +keywords: [llamaindex]
5 ---
6
7 -The LlamaIndex Provider transforms Composio tools into a format compatible with LlamaIndex's function calling capabilities.
7 +The LlamaIndex provider transforms Composio tools into LlamaIndex's [FunctionTool](https://docs.llamaindex.ai/en/stable/module_guides/deploying/agents/) format with built-in execution.
8
9 -## Setup
9 +<Steps>
10 +<Step>
11 +**Install**
12
11 -<Tabs items={["Python", "TypeScript"]}>
13 +<Tabs groupId="language" items={["Python", "TypeScript"]} persist>
14 <Tab value="Python">
15 ```bash
14 -pip install composio composio_llamaindex llama-index
16 +pip install composio composio_llamaindex llama-index llama-index-llms-openai
17 ```
18 </Tab>
19 <Tab value="TypeScript">
@@ -20,49 +22,54 @@ npm install @composio/core @composio/llamaindex @llamaindex/openai @llamaindex/w
22 ```
23 </Tab>
24 </Tabs>
25 +</Step>
26
24 -## Usage
27 +<Step>
28 +**Configure API Keys**
29
26 -<Tabs items={["Python", "TypeScript"]}>
30 +<Callout type="info">
31 +Set `COMPOSIO_API_KEY` with your API key from [Settings](https://platform.composio.dev/?next_page=/settings) and `OPENAI_API_KEY` with your [OpenAI API key](https://platform.openai.com/api-keys).
32 +</Callout>
33 +
34 +```txt title=".env"
35 +COMPOSIO_API_KEY=xxxxxxxxx
36 +OPENAI_API_KEY=xxxxxxxxx
37 +```
38 +</Step>
39 +
40 +<Step>
41 +**Create session and run**
42 +
43 +<Tabs groupId="language" items={["Python", "TypeScript"]} persist>
44 <Tab value="Python">
45 ```python
46 import asyncio
30 -from dotenv import load_dotenv
47 from composio import Composio
48 from composio_llamaindex import LlamaIndexProvider
49 from llama_index.core.agent.workflow import FunctionAgent
50 from llama_index.llms.openai import OpenAI
51
36 -load_dotenv()
37 -
38 -llm = OpenAI(model="gpt-5")
52 composio = Composio(provider=LlamaIndexProvider())
53 +llm = OpenAI(model="gpt-5.2")
54
55 # Create a session for your user
56 session = composio.create(user_id="user_123")
57 tools = session.tools()
58
45 -workflow = FunctionAgent(
46 - tools=tools,
47 - llm=llm,
48 - system_prompt="You are an agent that performs github actions.",
49 -)
50 -
59 +agent = FunctionAgent(tools=tools, llm=llm)
60
61 async def main():
53 - result = await workflow.run(
54 - user_msg="Star the composiohq/composio repository on GitHub"
62 + result = await agent.run(
63 + user_msg="Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'"
64 )
65 print(result)
66
58 -
59 -if __name__ == "__main__":
60 - asyncio.run(main())
67 +asyncio.run(main())
68 ```
69 </Tab>
70 <Tab value="TypeScript">
71 ```typescript
65 -import 'dotenv/config';
72 +// @noErrors
73 import { Composio } from '@composio/core';
74 import { LlamaindexProvider } from '@composio/llamaindex';
75 import { openai } from '@llamaindex/openai';
@@ -76,19 +83,18 @@ const composio = new Composio({
83 const session = await composio.create("user_123");
84 const tools = await session.tools();
85
79 -const githubAgent = agent({
80 - name: 'GitHub Agent',
81 - description: 'An agent that performs GitHub actions',
82 - llm: openai({ model: 'gpt-4o-mini' }),
83 - systemPrompt: 'You are an agent that performs github actions.',
86 +const myAgent = agent({
87 + llm: openai({ model: 'gpt-5.2' }),
88 tools,
89 });
90
87 -const result = await githubAgent.run(
88 - 'Star the composiohq/composio repository on GitHub'
91 +const result = await myAgent.run(
92 + "Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'"
93 );
94
91 -console.log(result);
95 +console.log(result.data.result);
96 ```
97 </Tab>
98 </Tabs>
99 +</Step>
100 +</Steps>