Composio allows developers to integrate external tools and services into their AI applications. It handles tool calling, webhooks, authentication, and more.You need a Composio account. Sign up for Composio if you haven’t already, to get a Composio API key.
Install libraries
uv add together composio-togetherai
npm install @composio/core @composio/vercel @ai-sdk/togetherai ai
Set your TOGETHER_API_KEY and COMPOSIO_API_KEY environment variables.
In this example, you use Together AI to star a repository on GitHub using Composio tools.
from composio_togetherai import ComposioToolSet, Appfrom together import Togetherclient = Together()toolset = ComposioToolSet()
/*We use the Vercel AI SDK with the Together provider to enable type checking to work correctly for tools and to simplify the Composio integration. This flow enables us to directly execute tool callswithout having to use composio.provider.handleToolCalls.*/import { Composio } from "@composio/core";import { VercelProvider } from "@composio/vercel";import { createTogetherAI } from "@ai-sdk/togetherai";import { generateText } from "ai";export const together = createTogetherAI({ apiKey: process.env.TOGETHER_API_KEY ?? "",});const composio = new Composio({ apiKey: process.env.COMPOSIO_API_KEY ?? "", provider: new VercelProvider(),});