/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { llmChatCreateChat } from "../../funcs/llmChatCreateChat.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.CreateChatCompletionRequest$inboundSchema, }; export const tool$llmChatCreateChat: ToolDefinition = { name: "llm-chat-create-chat", description: `[Deprecated] Chat completions for OpenAI SDK/client usage **Deprecated: Use the Responses API (\`/api/v1/llm/responses\`) instead.** OpenAI-compatible chat completion endpoint designed for use with the official OpenAI client libraries (Python, Node.js, etc.). Supports both streaming and non-streaming requests by setting the \`stream\` parameter. This endpoint handles the request/response directly and returns standard OpenAI-formatted responses. Use this when integrating with existing OpenAI client code. Note: The actual handler is registered at the Bun server level for optimal performance with the OpenAI SDK streaming format.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await llmChatCreateChat( client, args.request, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value; return formatResult(value, apiCall); }, };