Providers

Providers in Composio act as bridges between your AI models and external tools. They transform Composio’s tools into formats that different AI frameworks can understand and use, making it possible to integrate with any AI framework seamlessly.

What are Providers?

Think of providers as translators. Different AI frameworks (like OpenAI, Anthropic Claude, or LangChain) expect tools to be formatted in their specific way. Instead of manually converting Composio tools for each framework, providers handle this transformation automatically.

For example:

  • OpenAI expects tools in a specific JSON schema format with type: “function”
  • Anthropic Claude expects tools with an input_schema structure
  • LangChain expects tools as callable functions with specific parameters

Providers ensure that Composio tools work correctly with your chosen AI platform without you having to worry about the technical details.

Using Providers

Here’s how you can generate text with various providers using Composio SDK:

Default Provider (OpenAI)

If you don’t specify a provider, Composio uses the OpenAI provider by default:

1from openai import OpenAI
2from composio import Composio
3
4# Initialize tools.
5openai_client = OpenAI()
6composio = Composio(api_key="your-composio-api-key")
7
8# Define task.
9task = "Star a repo composiohq/composio on GitHub"
10
11# Get GitHub tools that are pre-configured
12tools = composio.tools.get(user_id="default", toolkits=["GITHUB"])
13
14# Get response from the LLM
15response = openai_client.chat.completions.create(
16 model="gpt-4o-mini",
17 tools=tools,
18 messages=[
19 {"role": "system", "content": "You are a helpful assistant."},
20 {"role": "user", "content": task},
21 ],
22)
23print(response)
24
25# Execute the function calls.
26result = composio.provider.handle_tool_calls(response=response, user_id="default")
27print(result)

Using a Different Provider

Different providers may require additional packages:

$# Core SDK (includes OpenAI provider)
>pip install composio==1.0.0rc9
>
># Additional providers
>pip install composio_anthropic==1.0.0rc9
>pip install composio_google==1.0.0rc9
>pip install composio_langchain==1.0.0rc9
>pip install composio_crewai==1.0.0rc9

To use a different provider, specify it when initializing Composio:

OpenAI is a completion provider. You can use it to generate text, function calls.

1from composio import Composio
2from composio_openai import OpenAIProvider
3
4composio = Composio(provider=OpenAIProvider())

Supported Providers

Composio supports two different types of providers based on the type of AI framework you are using:

Non-Agentic Providers

These providers work with AI platforms that use chat completion APIs, where you control the tool execution flow. The AI model analyzes your conversation and suggests which tools to use, but your code decides when and how to execute them. With chat completion APIs, the typical flow is:

  1. You send a message to the AI model along with available tools
  2. The AI responds with either a text message or a request to use specific tools
  3. If tools are requested, you execute them and send the results back to continue the conversation

Agentic Providers

These providers work with AI frameworks that can execute tools autonomously. The AI agent can decide to run tools on its own without your direct intervention.

Custom Providers

Using a framework not yet supported by Composio? Create a custom provider!