OpenAIToolSet

composio-core


composio-core / index / OpenAIToolSet

Class: OpenAIToolSet

Defined in: js/src/frameworks/openai.ts:14

Extends

Constructors

Constructor

new OpenAIToolSet(config): OpenAIToolSet

Defined in: js/src/frameworks/openai.ts:27

Composio toolset for OpenAI framework.

Example:

Parameters

config
allowTracing?

boolean

apiKey?

string

baseUrl?

string

connectedAccountIds?

Record<string, string>

entityId?

string

Returns

OpenAIToolSet

Overrides

ComposioToolSet.constructor

Properties

actions

actions: Actions

Defined in: js/src/sdk/base.toolset.ts:51

Inherited from

ComposioToolSet.actions


activeTriggers

activeTriggers: ActiveTriggers

Defined in: js/src/sdk/base.toolset.ts:54

Inherited from

ComposioToolSet.activeTriggers


apiKey

apiKey: string

Defined in: js/src/sdk/base.toolset.ts:43

Inherited from

ComposioToolSet.apiKey


apps

apps: Apps

Defined in: js/src/sdk/base.toolset.ts:50

Inherited from

ComposioToolSet.apps


backendClient

backendClient: AxiosBackendClient

Defined in: js/src/sdk/base.toolset.ts:48

Inherited from

ComposioToolSet.backendClient


client

client: Composio

Defined in: js/src/sdk/base.toolset.ts:42

Inherited from

ComposioToolSet.client


connectedAccountIds

connectedAccountIds: Record<string, string> = {}

Defined in: js/src/sdk/base.toolset.ts:46

Inherited from

ComposioToolSet.connectedAccountIds


connectedAccounts

connectedAccounts: ConnectedAccounts

Defined in: js/src/sdk/base.toolset.ts:49

Inherited from

ComposioToolSet.connectedAccounts


entityId

entityId: string = "default"

Defined in: js/src/sdk/base.toolset.ts:45

Inherited from

ComposioToolSet.entityId


fileName

fileName: string = "js/src/frameworks/openai.ts"

Defined in: js/src/frameworks/openai.ts:17


integrations

integrations: Integrations

Defined in: js/src/sdk/base.toolset.ts:53

Inherited from

ComposioToolSet.integrations


runtime

runtime: string

Defined in: js/src/sdk/base.toolset.ts:44

Inherited from

ComposioToolSet.runtime


triggers

triggers: Triggers

Defined in: js/src/sdk/base.toolset.ts:52

Inherited from

ComposioToolSet.triggers


userActionRegistry

userActionRegistry: ActionRegistry

Defined in: js/src/sdk/base.toolset.ts:56

Inherited from

ComposioToolSet.userActionRegistry


DEFAULT_ENTITY_ID

static DEFAULT_ENTITY_ID: string = "default"

Defined in: js/src/frameworks/openai.ts:16


FRAMEWORK_NAME

static FRAMEWORK_NAME: string = "openai"

Defined in: js/src/frameworks/openai.ts:15

Methods

addPostProcessor()

addPostProcessor(processor): Promise<OpenAIToolSet>

Defined in: js/src/sdk/base.toolset.ts:369

Parameters

processor

TPostProcessor

Returns

Promise<OpenAIToolSet>

Inherited from

ComposioToolSet.addPostProcessor


addPreProcessor()

addPreProcessor(processor): Promise<OpenAIToolSet>

Defined in: js/src/sdk/base.toolset.ts:359

Parameters

processor

TPreProcessor

Returns

Promise<OpenAIToolSet>

Inherited from

ComposioToolSet.addPreProcessor


addSchemaProcessor()

addSchemaProcessor(processor): Promise<OpenAIToolSet>

Defined in: js/src/sdk/base.toolset.ts:349

Parameters

processor

TSchemaProcessor

Returns

Promise<OpenAIToolSet>

Inherited from

ComposioToolSet.addSchemaProcessor


createAction()

createAction<P>(options): Promise<{ appId: string; appKey: string; appName: string; description: string; display_name: string; enabled: boolean; logo: string; metadata: { name: string; toolName: string; }; name: string; parameters: { description: string; properties: Record<string, any>; required: string[]; title: string; type: string; }; response: Record<string, any>; tags: string[]; }>

Defined in: js/src/sdk/base.toolset.ts:225

Type Parameters

P

P extends Parameters = ZodObject<{}, UnknownKeysParam, ZodTypeAny, {}, {}>

Parameters

options

CreateActionOptions<P>

Returns

Promise<{ appId: string; appKey: string; appName: string; description: string; display_name: string; enabled: boolean; logo: string; metadata: { name: string; toolName: string; }; name: string; parameters: { description: string; properties: Record<string, any>; required: string[]; title: string; type: string; }; response: Record<string, any>; tags: string[]; }>

Inherited from

ComposioToolSet.createAction


executeAction()

executeAction(functionParams): Promise<ActionExecutionResDto>

Defined in: js/src/sdk/base.toolset.ts:241

Parameters

functionParams

ExecuteActionParams

Returns

Promise<ActionExecutionResDto>

Inherited from

ComposioToolSet.executeAction


executeToolCall()

executeToolCall(tool, entityId): Promise<string>

Defined in: js/src/frameworks/openai.ts:77

Parameters

tool

ChatCompletionMessageToolCall

entityId

string = null

Returns

Promise<string>


getActionsSchema()

getActionsSchema(filters, _entityId?): Promise<object[]>

Defined in: js/src/sdk/base.toolset.ts:138

Parameters

filters
actions?

Sequence<string>

_entityId?

string

Returns

Promise<object[]>

Inherited from

ComposioToolSet.getActionsSchema


getEntity()

getEntity(entityId): Promise<Entity>

Defined in: js/src/sdk/base.toolset.ts:237

Parameters

entityId

string

Returns

Promise<Entity>

Inherited from

ComposioToolSet.getEntity


getTools()

getTools(filters, entityId?): Promise<Sequence<ChatCompletionTool>>

Defined in: js/src/frameworks/openai.ts:46

Parameters

filters
actions?

string[] = ...

apps?

string[] = ...

filterByAvailableApps?

boolean = ...

integrationId?

string = ...

tags?

string[] = ...

useCase?

string = ...

useCaseLimit?

number = ...

entityId?

string

Returns

Promise<Sequence<ChatCompletionTool>>


getToolsSchema()

getToolsSchema(filters, _entityId?, _integrationId?): Promise<object[]>

Defined in: js/src/sdk/base.toolset.ts:150

Parameters

filters
actions?

string[] = ...

apps?

string[] = ...

filterByAvailableApps?

boolean = ...

integrationId?

string = ...

tags?

string[] = ...

useCase?

string = ...

useCaseLimit?

number = ...

_entityId?

string

_integrationId?

string

Returns

Promise<object[]>

Inherited from

ComposioToolSet.getToolsSchema


handleAssistantMessage()

handleAssistantMessage(run, entityId): Promise<ToolOutput[]>

Defined in: js/src/frameworks/openai.ts:123

Parameters

run

Run

entityId

string = null

Returns

Promise<ToolOutput[]>


handleToolCall()

handleToolCall(chatCompletion, entityId): Promise<Sequence<string>>

Defined in: js/src/frameworks/openai.ts:103

Parameters

chatCompletion

ChatCompletion

entityId

string = null

Returns

Promise<Sequence<string>>


removePostProcessor()

removePostProcessor(): Promise<void>

Defined in: js/src/sdk/base.toolset.ts:383

Returns

Promise<void>

Inherited from

ComposioToolSet.removePostProcessor


removePreProcessor()

removePreProcessor(): Promise<void>

Defined in: js/src/sdk/base.toolset.ts:379

Returns

Promise<void>

Inherited from

ComposioToolSet.removePreProcessor


removeSchemaProcessor()

removeSchemaProcessor(): Promise<void>

Defined in: js/src/sdk/base.toolset.ts:387

Returns

Promise<void>

Inherited from

ComposioToolSet.removeSchemaProcessor


waitAndHandleAssistantStreamToolCalls()

waitAndHandleAssistantStreamToolCalls(client, runStream, thread, entityId): AsyncGenerator<unknown, void, unknown>

Defined in: js/src/frameworks/openai.ts:158

Parameters

client

OpenAI

runStream

Stream<AssistantStreamEvent>

thread

Thread

entityId

string = null

Returns

AsyncGenerator<unknown, void, unknown>


waitAndHandleAssistantToolCalls()

waitAndHandleAssistantToolCalls(client, run, thread, entityId): Promise<Run>

Defined in: js/src/frameworks/openai.ts:243

Parameters

client

OpenAI

run

Run

thread

Thread

entityId

string = null

Returns

Promise<Run>