import { ChatCompletion, ChatCompletionCreateParams, ChatCompletionMessageToolCall, ChatCompletionTool } from "../resources/chat/completions.js"; import { ChatCompletionStreamingToolRunnerParams, ChatCompletionStreamParams, ChatCompletionToolRunnerParams, ParsedChatCompletion } from "../resources/beta/chat/completions.js"; import { ResponseFormatJSONSchema } from "../resources/shared.js"; type AnyChatCompletionCreateParams = ChatCompletionCreateParams | ChatCompletionToolRunnerParams | ChatCompletionStreamingToolRunnerParams | ChatCompletionStreamParams; export type ExtractParsedContentFromParams = Params['response_format'] extends AutoParseableResponseFormat ? P : null; export type AutoParseableResponseFormat = ResponseFormatJSONSchema & { __output: ParsedT; $brand: 'auto-parseable-response-format'; $parseRaw(content: string): ParsedT; }; export declare function makeParseableResponseFormat(response_format: ResponseFormatJSONSchema, parser: (content: string) => ParsedT): AutoParseableResponseFormat; export declare function isAutoParsableResponseFormat(response_format: any): response_format is AutoParseableResponseFormat; type ToolOptions = { name: string; arguments: any; function?: ((args: any) => any) | undefined; }; export type AutoParseableTool = ChatCompletionTool & { __arguments: OptionsT['arguments']; __name: OptionsT['name']; __hasFunction: HasFunction; $brand: 'auto-parseable-tool'; $callback: ((args: OptionsT['arguments']) => any) | undefined; $parseRaw(args: string): OptionsT['arguments']; }; export declare function makeParseableTool(tool: ChatCompletionTool, { parser, callback, }: { parser: (content: string) => OptionsT['arguments']; callback: ((args: any) => any) | undefined; }): AutoParseableTool; export declare function isAutoParsableTool(tool: any): tool is AutoParseableTool; export declare function maybeParseChatCompletion>>(completion: ChatCompletion, params: Params): ParsedChatCompletion; export declare function parseChatCompletion>(completion: ChatCompletion, params: Params): ParsedChatCompletion; export declare function shouldParseToolCall(params: ChatCompletionCreateParams | null | undefined, toolCall: ChatCompletionMessageToolCall): boolean; export declare function hasAutoParseableInput(params: AnyChatCompletionCreateParams): boolean; export declare function validateInputTools(tools: ChatCompletionTool[] | undefined): void; export {}; //# sourceMappingURL=parser.d.ts.map