{
  "result": {
    "0.16.0": {
      "name": "composio",
      "version": "0.16.0",
      "metadata_version": "2.4",
      "summary": "SDK for integrating Composio with your applications.",
      "home_page": "https://github.com/composiohq/composio",
      "author": "Composio",
      "author_email": "tech@composio.dev",
      "maintainer": "",
      "maintainer_email": "",
      "license": "",
      "description": "![Composio Banner](https://github.com/user-attachments/assets/9ba0e9c1-85a4-4b51-ae60-f9fe7992e819)\n\n# Composio\n\nThe Composio Python SDK allows you to interact with the Composio Platform. It provides a powerful and flexible way to manage and execute tools, handle authentication, and integrate with various AI frameworks and platforms.\n\n[Learn more about the SDK from our docs](https://docs.composio.dev)\n\n## Core Features\n\n- **Tools**: Manage and execute tools within the Composio ecosystem. Includes functionality to list, retrieve, and execute tools.\n- **Toolkits**: Organize and manage collections of tools for specific use cases.\n- **Triggers**: Create and manage event triggers that can execute tools based on specific conditions.\n- **AuthConfigs**: Configure authentication providers and settings.\n- **ConnectedAccounts**: Manage third-party service connections.\n- **ActionExecution**: Track and manage the execution of actions within the platform.\n- **Provider Integrations**: Built-in support for OpenAI, Anthropic, LangChain, CrewAI, AutoGen, and more.\n\n## Installation\n\n```bash\npip install composio\n# or\npip install composio-core\n```\n\n### Provider-Specific Installations\n\nFor specific AI framework integrations:\n\n```bash\n# OpenAI integration\npip install composio-openai\n\n# LangChain integration  \npip install composio-langchain\n\n# CrewAI integration\npip install composio-crewai\n\n# Anthropic integration\npip install composio-anthropic\n\n# AutoGen integration\npip install composio-autogen\n\n# And many more...\n```\n\n## Getting Started\n\n### Basic Usage with OpenAI\n\n```python\nimport os\nfrom composio import Composio\nfrom openai import OpenAI\n\n# Initialize OpenAI client\nopenai_client = OpenAI(api_key=os.getenv(\"OPENAI_API_KEY\"))\n\n# Initialize Composio with your API key\ncomposio = Composio(api_key=os.getenv(\"COMPOSIO_API_KEY\"))\n\ndef main():\n    try:\n        # Fetch tools - single tool or multiple tools\n        tools = composio.tools.get(user_id=\"default\", slug=\"HACKERNEWS_GET_USER\")\n        # Or fetch multiple tools: composio.tools.get(user_id=\"default\", toolkits=[\"hackernews\"])\n\n        query = \"Find information about the HackerNews user 'pg'\"\n\n        # Create chat completion with tools\n        response = openai_client.chat.completions.create(\n            model=\"gpt-4o\",\n            messages=[\n                {\n                    \"role\": \"system\", \n                    \"content\": \"You are a helpful assistant that can use tools to answer questions.\"\n                },\n                {\"role\": \"user\", \"content\": query}\n            ],\n            tools=tools,\n            tool_choice=\"auto\"\n        )\n\n        # Handle tool calls if the assistant decides to use them\n        if response.choices[0].message.tool_calls:\n            print(\"\ud83d\udd27 Assistant is using tool:\", response.choices[0].message.tool_calls[0].function.name)\n            \n            # Execute the tool call\n            tool_result = composio.provider.handle_tool_calls(\n                response=response,\n                user_id=\"default\"\n            )\n            \n            print(\"\u2705 Tool execution result:\", tool_result)\n            \n            # Get final response from assistant with tool result\n            final_response = openai_client.chat.completions.create(\n                model=\"gpt-4o\",\n                messages=[\n                    {\n                        \"role\": \"system\",\n                        \"content\": \"You are a helpful assistant that can use tools to answer questions.\"\n                    },\n                    {\"role\": \"user\", \"content\": query},\n                    response.choices[0].message,\n                    {\n                        \"role\": \"tool\",\n                        \"tool_call_id\": response.choices[0].message.tool_calls[0].id,\n                        \"content\": str(tool_result)\n                    }\n                ]\n            )\n            \n            print(\"\ud83e\udd16 Final response:\", final_response.choices[0].message.content)\n        else:\n            print(\"\ud83e\udd16 Response:\", response.choices[0].message.content)\n            \n    except Exception as error:\n        print(\"\u274c Error:\", error)\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### Using with Provider Integrations\n\n#### OpenAI Provider\n\n```python\nfrom composio_openai import OpenAIProvider\nfrom openai import OpenAI\nfrom composio import Composio\n\n# Initialize with OpenAI provider\nopenai_client = OpenAI()\ncomposio = Composio(provider=OpenAIProvider())\n\n# Define task\ntask = \"Star a repo composiohq/composio on GitHub\"\n\n# Get GitHub tools that are pre-configured\ntools = composio.tools.get(user_id=\"default\", toolkits=[\"GITHUB\"])\n\n# Get response from the LLM\nresponse = openai_client.chat.completions.create(\n    model=\"gpt-4o-mini\",\n    tools=tools,\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n        {\"role\": \"user\", \"content\": task},\n    ],\n)\n\n# Execute the function calls\nresult = composio.provider.handle_tool_calls(response=response, user_id=\"default\")\nprint(result)\n```\n\n#### LangChain Integration\n\n```python\nfrom composio_langchain import ComposioToolSet\nfrom langchain_openai import ChatOpenAI\n\n# Initialize the toolset\ntoolset = ComposioToolSet()\n\n# Get tools for a specific toolkit\ntools = toolset.get_tools(toolkits=[\"GITHUB\"])\n\n# Initialize LLM\nllm = ChatOpenAI(model=\"gpt-4o\")\n\n# Create agent with tools\nfrom langchain.agents import create_openai_functions_agent, AgentExecutor\nfrom langchain.prompts import ChatPromptTemplate\n\nprompt = ChatPromptTemplate.from_messages([\n    (\"system\", \"You are a helpful assistant\"),\n    (\"user\", \"{input}\"),\n    (\"assistant\", \"{agent_scratchpad}\")\n])\n\nagent = create_openai_functions_agent(llm, tools, prompt)\nagent_executor = AgentExecutor(agent=agent, tools=tools)\n\n# Execute task\nresult = agent_executor.invoke({\"input\": \"Star the composiohq/composio repository\"})\nprint(result)\n```\n\n## Configuration\n\nThe Composio constructor accepts the following configuration options:\n\n```python\nfrom composio import Composio\nfrom composio.core.provider import OpenAIProvider\n\ncomposio = Composio(\n    api_key=\"your-api-key\",  # Your Composio API key\n    base_url=\"https://api.composio.dev\",  # Custom API base URL (optional)\n    timeout=60,  # Request timeout in seconds\n    max_retries=3,  # Maximum number of retries\n    allow_tracking=True,  # Enable/disable telemetry (default: True)\n    file_download_dir=\"./downloads\",  # Directory for file downloads\n    provider=OpenAIProvider(),  # Custom provider (default: OpenAIProvider)\n    toolkit_versions={ \"github\": \"12202025_01\" }  # Toolkit versions to use\n)\n```\n\n## Modifiers\n\nComposio SDK supports powerful modifiers to transform tool schemas and execution behavior.\n\n### Schema Modifiers\n\nSchema modifiers allow you to transform tool schemas before they are used:\n\n```python\nfrom composio import schema_modifier\nfrom composio.types import Tool\n\n@schema_modifier(tools=[\"HACKERNEWS_GET_USER\"])\ndef modify_schema(tool: str, toolkit: str, schema: Tool) -> Tool:\n    # Perform modifications on the schema\n    schema[\"description\"] = \"Enhanced HackerNews user lookup with additional features\"\n    schema[\"parameters\"][\"properties\"][\"include_karma\"] = {\n        \"type\": \"boolean\",\n        \"description\": \"Include user karma in response\",\n        \"default\": True\n    }\n    return schema\n\n# Use the modifier when getting tools\ntools = composio.tools.get(\n    user_id=\"default\",\n    slug=\"HACKERNEWS_GET_USER\",\n    modifiers=[modify_schema]\n)\n```\n\n### Execution Modifiers\n\nTransform tool execution behavior with before and after execute modifiers:\n\n```python\nfrom composio import before_execute, after_execute\nfrom composio.types import ToolExecuteParams, ToolExecutionResponse\n\n@before_execute(tools=[\"HACKERNEWS_GET_USER\"])\ndef before_execute_modifier(\n    tool: str,\n    toolkit: str, \n    params: ToolExecuteParams\n) -> ToolExecuteParams:\n    # Transform input before execution\n    print(f\"Executing {tool} with params: {params}\")\n    return params\n\n@after_execute(tools=[\"HACKERNEWS_GET_USER\"])\ndef after_execute_modifier(\n    tool: str,\n    toolkit: str,\n    response: ToolExecutionResponse\n) -> ToolExecutionResponse:\n    # Transform output after execution\n    return {\n        **response,\n        \"data\": {\n            **response[\"data\"],\n            \"processed_at\": \"2024-01-01T00:00:00Z\"\n        }\n    }\n\n# Execute tool with modifiers\nresponse = composio.tools.execute(\n    user_id=\"default\",\n    slug=\"HACKERNEWS_GET_USER\", \n    arguments={\"username\": \"pg\"},\n    modifiers=[before_execute_modifier, after_execute_modifier]\n)\n```\n\n## Connected Accounts\n\nComposio SDK provides a powerful way to manage third-party service connections through Connected Accounts. This feature allows you to authenticate with various services and maintain those connections.\n\n### Creating a Connected Account\n\n```python\nfrom composio import Composio\nfrom composio.types import auth_scheme\n\ncomposio = Composio(api_key=os.getenv(\"COMPOSIO_API_KEY\"))\n\n# Create a connected account with OAuth\nconnection_request = composio.connected_accounts.initiate(\n    user_id=\"user123\",\n    auth_config_id=\"ac_12343544\",  # You can create it from the dashboard\n    callback_url=\"https://your-app.com/callback\",\n    data={\n        # Additional data for the connection\n        \"scope\": [\"read\", \"write\"]\n    }\n)\n\n# Wait for the connection to be established\n# Default timeout is 60 seconds\nconnected_account = connection_request.wait_for_connection()\nprint(connected_account)\n```\n\n### API Key Authentication\n\n```python\n# Create a connected account with API Key\nconnection_request = composio.connected_accounts.initiate(\n    user_id=\"user123\", \n    auth_config_id=\"ac_12343544\",\n    config=auth_scheme.api_key(\n        options={\n            \"api_key\": \"your-api-key-here\"\n        }\n    )\n)\n```\n\n### Managing Connected Accounts\n\n```python\n# List all connected accounts\naccounts = composio.connected_accounts.list(user_id=\"user123\")\n\n# Get a specific connected account\naccount = composio.connected_accounts.get(\"account_id\")\n\n# Enable/Disable a connected account\ncomposio.connected_accounts.enable(\"account_id\")\ncomposio.connected_accounts.disable(\"account_id\")\n\n# Refresh credentials\ncomposio.connected_accounts.refresh(\"account_id\")\n\n# Delete a connected account\ncomposio.connected_accounts.delete(\"account_id\")\n```\n\n### Connection Statuses\n\nConnected accounts can have the following statuses:\n\n- `ACTIVE`: Connection is established and working\n- `INACTIVE`: Connection is temporarily disabled  \n- `PENDING`: Connection is being processed\n- `INITIATED`: Connection request has started\n- `EXPIRED`: Connection credentials have expired\n- `FAILED`: Connection attempt failed\n\n## Tools and Toolkits\n\n### Working with Tools\n\n```python\n# Get tools by toolkit\ntools = composio.tools.get(user_id=\"default\", toolkits=[\"GITHUB\"])\n\n# Get tools by search\ntools = composio.tools.get(user_id=\"default\", search=\"user\")\n\n# Get tools by toolkit and search\ntools = composio.tools.get(user_id=\"default\", toolkits=[\"GITHUB\"], search=\"star\")\n\n# Execute a tool directly\nresponse = composio.tools.execute(\n    user_id=\"default\",\n    slug=\"HACKERNEWS_GET_USER\",\n    arguments={\"username\": \"pg\"}\n)\nprint(response)\n```\n\n### Proxy Calls\n\nMake direct API calls through connected accounts:\n\n```python\n# Execute proxy call (GitHub API)\nproxy_response = composio.tools.proxy(\n    endpoint=\"/repos/composiohq/composio/issues/1\",\n    method=\"GET\", \n    connected_account_id=\"ac_1234\",  # Use connected account for GitHub\n    parameters=[\n        {\n            \"name\": \"Accept\",\n            \"value\": \"application/vnd.github.v3+json\", \n            \"type\": \"header\"\n        }\n    ]\n)\nprint(proxy_response)\n```\n\n## Authentication Schemes\n\nComposio supports various authentication schemes:\n\n- OAuth2\n- OAuth1  \n- OAuth1a\n- API Key\n- Basic Auth\n- Bearer Token\n- Google Service Account\n- And more...\n\n## Environment Variables\n\n- `COMPOSIO_API_KEY`: Your Composio API key\n- `COMPOSIO_BASE_URL`: Custom API base URL\n- `COMPOSIO_LOGGING_LEVEL`: Logging level (silent, error, warn, info, debug)\n- `DEVELOPMENT`: Development mode flag\n- `COMPOSIO_TOOLKIT_VERSION_<TOOLKITNAME>`: Version of the specific toolkit\n- `CI`: CI environment flag\n\n## MCP (Model Context Protocol)\n\nCreate MCP servers for seamless integration with Claude, Cursor, and other MCP-compatible tools:\n\n```python\nfrom composio import Composio\n\ncomposio = Composio()\n\n# Create MCP server\nmcp_server = composio.mcp.create(\n    \"my-mcp-server\",\n    toolkits=[\"github\", \"gmail\"],\n    manually_manage_connections=False\n)\n\n# Generate server instance for a user\nserver_instance = mcp_server.generate(\"user123\")\nprint(f\"MCP Server URL: {server_instance['url']}\")\n```\n\n## Supported AI Frameworks\n\nComposio provides dedicated integrations for popular AI frameworks:\n\n- **OpenAI** - Direct integration with OpenAI's API\n- **LangChain** - Tools and agents for LangChain workflows\n- **LangGraph** - State machine workflows with LangGraph\n- **CrewAI** - Multi-agent systems with CrewAI\n- **AutoGen** - Microsoft's AutoGen framework\n- **Anthropic** - Claude integration\n- **Google AI** - Gemini and other Google AI services\n- **LlamaIndex** - RAG and data framework integration\n\n## Error Handling\n\n```python\nfrom composio import Composio\nfrom composio.exceptions import ComposioError, ApiKeyNotProvidedError\n\ntry:\n    composio = Composio()  # Will raise ApiKeyNotProvidedError if no API key\n    tools = composio.tools.get(user_id=\"default\", toolkits=[\"GITHUB\"])\nexcept ApiKeyNotProvidedError:\n    print(\"Please provide COMPOSIO_API_KEY environment variable\")\nexcept ComposioError as e:\n    print(f\"Composio error: {e}\")\nexcept Exception as e:\n    print(f\"Unexpected error: {e}\")\n```\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](../CONTRIBUTING.md) for more details.\n\n## License\n\nApache License 2.0\n\n## Support\n\nFor support, please visit our [Documentation](https://docs.composio.dev) or join our [Discord Community](https://discord.gg/composio).\n",
      "keywords": "",
      "platform": [],
      "classifiers": [
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: OS Independent",
        "Environment :: MetaData :: IBM Python Ecosystem"
      ],
      "download_url": "",
      "supported_platform": [],
      "comment": "",
      "provides": [],
      "requires": [],
      "obsoletes": [],
      "project_urls": [],
      "provides_dist": [],
      "obsoletes_dist": [],
      "requires_dist": [
        "pysher>=1.0.8",
        "pydantic>=2.13.4",
        "composio-client==1.41.0",
        "typing-extensions>=4.15.0",
        "openai>=2.42.0",
        "json-schema-to-pydantic>=0.4.11"
      ],
      "requires_external": [],
      "requires_python": ">=3.10,<4",
      "description_content_type": "text/markdown",
      "provides_extras": [],
      "dynamic": [
        "author",
        "author-email",
        "home-page",
        "requires-python"
      ],
      "license_expression": "",
      "license_file": [],
      "+links": [
        {
          "rel": "releasefile",
          "hash_spec": "sha256=59f9de43bd4bbf0e1fe6c1a8589eb486094407dff91c32ff465455a11525afac",
          "hashes": {
            "sha256": "59f9de43bd4bbf0e1fe6c1a8589eb486094407dff91c32ff465455a11525afac"
          },
          "href": "https://wheels.developerfirst.ibm.com/ppc64le/linux/+f/59f/9de43bd4bbf0e/composio-0.16.0-py3-none-any.whl",
          "log": [
            {
              "what": "upload",
              "who": "ppc64le",
              "when": [
                2026,
                8,
                28,
                5,
                54,
                25
              ],
              "dst": "ppc64le/linux"
            }
          ]
        }
      ]
    }
  },
  "type": "projectconfig"
}
