Skip to content

AIDK API Reference / aidk-openai / mapToolDefinition

Function: mapToolDefinition() ​

ts
function mapToolDefinition(tool: any): ChatCompletionFunctionTool;

Defined in: packages/adapters/openai/src/openai.ts:236

Map tool definition to OpenAI format

We only support function tools (not custom tools), so we return ChatCompletionFunctionTool explicitly for proper type safety.

Parameters ​

ParameterType
toolany

Returns ​

ChatCompletionFunctionTool

Released under the MIT License.