Skip to main content

getOpenAiFunction

client.codeboltTools.getOpenAiFunction(toolName: string): Promise<OpenAiFunction>

Retrieves a specific tool formatted as an OpenAI function.

Returns a single tool in OpenAI's functions schema format for targeted integration with the legacy function calling API.

Parameters

ParameterTypeRequiredDescription
toolNamestringYesThe name of the tool to retrieve

Returns

Promise<OpenAiFunction> — A promise that resolves to the OpenAiFunction object

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.codeboltTools.getOpenAiFunction('toolName');
console.log(result);