Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
docs: Update LlamaIndex provider page with Steps pattern
Sushmithamallesh40fd71e4d114
diff --git a/docs/content/docs/providers/llamaindex.mdx b/docs/content/docs/providers/llamaindex.mdxindex a0fe5c57a..0a855a2c6 100644--- a/docs/content/docs/providers/llamaindex.mdx+++ b/docs/content/docs/providers/llamaindex.mdx@@ -1,17 +1,19 @@---title: LlamaIndexdescription: Build an agent with LlamaIndex and enable it to use 800+ tools with Composio.-keywords: [workflow, function agent]+keywords: [llamaindex]----The LlamaIndex Provider transforms Composio tools into a format compatible with LlamaIndex's function calling capabilities.+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.-## Setup+<Steps>+<Step>+**Install**-<Tabs items={["Python", "TypeScript"]}>+<Tabs groupId="language" items={["Python", "TypeScript"]} persist><Tab value="Python">```bash-pip install composio composio_llamaindex llama-index+pip install composio composio_llamaindex llama-index llama-index-llms-openai```</Tab><Tab value="TypeScript">@@ -20,49 +22,54 @@ npm install @composio/core @composio/llamaindex @llamaindex/openai @llamaindex/w```</Tab></Tabs>+</Step>-## Usage+<Step>+**Configure API Keys**-<Tabs items={["Python", "TypeScript"]}>+<Callout type="info">+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).+</Callout>++```txt title=".env"+COMPOSIO_API_KEY=xxxxxxxxx+OPENAI_API_KEY=xxxxxxxxx+```+</Step>++<Step>+**Create session and run**++<Tabs groupId="language" items={["Python", "TypeScript"]} persist><Tab value="Python">```pythonimport asyncio-from dotenv import load_dotenvfrom composio import Composiofrom composio_llamaindex import LlamaIndexProviderfrom llama_index.core.agent.workflow import FunctionAgentfrom llama_index.llms.openai import OpenAI-load_dotenv()--llm = OpenAI(model="gpt-5")composio = Composio(provider=LlamaIndexProvider())+llm = OpenAI(model="gpt-5.2")# Create a session for your usersession = composio.create(user_id="user_123")tools = session.tools()-workflow = FunctionAgent(- tools=tools,- llm=llm,- system_prompt="You are an agent that performs github actions.",-)-+agent = FunctionAgent(tools=tools, llm=llm)async def main():- result = await workflow.run(- user_msg="Star the composiohq/composio repository on GitHub"+ result = await agent.run(+ user_msg="Send an email to [email protected] with the subject 'Hello' and body 'Hello from Composio!'")print(result)--if __name__ == "__main__":- asyncio.run(main())+asyncio.run(main())```</Tab><Tab value="TypeScript">```typescript-import 'dotenv/config';+// @noErrorsimport { Composio } from '@composio/core';import { LlamaindexProvider } from '@composio/llamaindex';import { openai } from '@llamaindex/openai';@@ -76,19 +83,18 @@ const composio = new Composio({const session = await composio.create("user_123");const tools = await session.tools();-const githubAgent = agent({- name: 'GitHub Agent',- description: 'An agent that performs GitHub actions',- llm: openai({ model: 'gpt-4o-mini' }),- systemPrompt: 'You are an agent that performs github actions.',+const myAgent = agent({+ llm: openai({ model: 'gpt-5.2' }),tools,});-const result = await githubAgent.run(- 'Star the composiohq/composio repository on GitHub'+const result = await myAgent.run(+ "Send an email to [email protected] with the subject 'Hello' and body 'Hello from Composio!'");-console.log(result);+console.log(result.data.result);```</Tab></Tabs>+</Step>+</Steps>