Cody

Learn how to use Cody with Composio

Overview

SLUG: CODY

Description

The magic of ChatGPT meets the expertise of a custom-made AI assistant trained on your specific business.

Authentication Details

generic_api_key
stringRequired

Connecting to Cody

Create an auth config

Use the dashboard to create an auth config for the Cody toolkit. This allows you to connect multiple Cody accounts to Composio for agents to use.

1

Select App

Navigate to Cody.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Cody Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4cody_auth_config_id = "ac_YOUR_CODY_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Cody for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, cody_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Cody toolkit’s playground

For code examples, see the Tool calling guide and Provider examples.

Tool List

Tool Name: Create Conversation

Description

Tool to create a new conversation with a specified bot. Use when starting a new conversation thread with optional focus mode to limit bot's knowledge base to specific documents.

Action Parameters

bot_id
stringRequired
document_ids
array
name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Document

Description

Tool to create a new document with text or HTML content in Cody AI. Use when you need to add documents to Cody's knowledge base with up to 768 KB of content.

Action Parameters

content
stringRequired
folder_id
stringRequired
name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Document From File

Description

Tool to create a document by uploading a file (up to 100 MB). Supports txt, md, rtf, pdf, ppt, pptx, pptm, doc, docx, docm formats. Use when you need to add file-based documents to Cody's knowledge base. The file is processed asynchronously.

Action Parameters

folder_id
string
key
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Document from Webpage

Description

Tool to create a document from a publicly accessible webpage URL. Use when you need to import content from a webpage into Cody AI. The webpage must be accessible without login. If request fails, ensure the URL is publicly accessible and not blocked by a firewall.

Action Parameters

folder_id
stringRequired
url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Folder

Description

Tool to create a new folder in Cody AI for organizing content. Use when you need to create a folder to organize documents or conversations.

Action Parameters

name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Conversation

Description

Tool to delete a conversation by its ID. Use when you need to permanently remove a conversation from the system.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Document

Description

Tool to delete a document by id. Use when removing a document that is no longer needed.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Conversation

Description

Tool to fetch a conversation by its ID from Cody AI. Use when you need to retrieve details about a specific conversation. Supports optional includes parameter to filter response to list document IDs.

Action Parameters

id
stringRequired
includes
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Document

Description

Tool to retrieve a specific document by its identifier from Cody AI. Use when you need to get details about a particular document including its status, content URL, and metadata.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Folder

Description

Tool to retrieve a specific folder by its identifier. Use when you need to get details about a folder.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Message

Description

Tool to fetch a specific message by its ID from Cody AI. Use when you need to retrieve details about a particular message, with optional includes for sources or usage metrics.

Action Parameters

id
stringRequired
includes
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Upload Signed URL

Description

Tool to get an AWS S3 signed upload URL for file uploads. Use when you need to obtain a signed URL to upload a file to Cody's storage.

Action Parameters

content_type
stringRequired
file_name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Bots

Description

Tool to get all bots with optional keyword filtering. Use when you need to retrieve the list of available bots in a Cody account.

Action Parameters

keyword
string

Action Response

data
arrayRequired
error
string
meta
objectRequired
successful
booleanRequired

Tool Name: List Conversations

Description

Tool to get all conversations with optional filtering by bot, keyword, or includes. Use when you need to retrieve conversation history, filter by bot, search by name, or get document associations.

Action Parameters

bot_id
string
includes
string
keyword
string

Action Response

data
arrayRequired
error
string
meta
objectRequired
successful
booleanRequired

Tool Name: List Documents

Description

Tool to retrieve all documents from Cody AI account with optional filtering. Use when you need to list documents by folder, conversation, or search by keyword. Returns document details including learning status and content URL.

Action Parameters

conversation_id
string
folder_id
string
keyword
string

Action Response

data
arrayRequired
error
string
meta
objectRequired
successful
booleanRequired

Tool Name: List Folders

Description

Tool to retrieve all folders with optional keyword filtering. Use when you need to list or search for folders in the account.

Action Parameters

keyword
string

Action Response

data
arrayRequired
error
string
meta
objectRequired
successful
booleanRequired

Tool Name: List Messages

Description

Tool to retrieve a paginated list of messages from Cody, optionally filtered by conversation. Use when you need to list messages, with optional filtering by conversation_id and extra attributes (sources or usage).

Action Parameters

conversation_id
string
includes
string

Action Response

data
arrayRequired
error
string
meta
objectRequired
successful
booleanRequired

Tool Name: Send Message

Description

Tool to send a message to Cody AI and receive an AI-generated response. Use when you need to send a user message to a conversation and get the AI's reply.

Action Parameters

content
stringRequired
conversation_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Send Message for Stream

Description

Tool to send a message to Cody AI and receive a Server-Sent Events (SSE) stream URL for the AI response. Use when you need streaming responses instead of waiting for the complete message. The response contains a stream_url that can be used to connect to the SSE stream and receive the AI's response in real-time chunks.

Action Parameters

content
stringRequired
conversation_id
stringRequired
redirect
boolean

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Conversation

Description

Tool to update a conversation by its ID including name, bot_id, and document_ids. Use when you need to modify an existing conversation's properties.

Action Parameters

bot_id
stringRequired
document_ids
array
id
stringRequired
name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Folder

Description

Tool to update a folder by its ID. Use when you need to modify an existing folder's name.

Action Parameters

id
stringRequired
name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired