UNPKG

@smithery/sdk

Version:

SDK to develop with Smithery

20 lines (19 loc) 849 B
import type { OpenAI } from "openai"; import type { ChatCompletionTool, ChatCompletionToolMessageParam } from "openai/resources/index.js"; import type { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js"; import type { Client } from "@modelcontextprotocol/sdk/client/index.js"; interface OpenAIAdapterOptions { strict?: boolean; truncateDescriptionLength?: number; } /** * Adapt an MCP client so it works seamlessly with OpenAI chat completions */ export declare class OpenAIChatAdapter { private client; private options; constructor(client: Pick<Client, "callTool" | "listTools">, options?: OpenAIAdapterOptions); listTools(): Promise<ChatCompletionTool[]>; callTool(response: OpenAI.Chat.Completions.ChatCompletion, options?: RequestOptions): Promise<ChatCompletionToolMessageParam[]>; } export {};