Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/openai/lib/parser.ts>maybeParseChatCompletion

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
function maybeParseChatCompletion
import { maybeParseChatCompletion } from "https://deno.land/x/openai@v4.64.0/lib/parser.ts";

Type Parameters

Params extends ChatCompletionCreateParams | null
optional
ParsedT = Params extends null ? null : ExtractParsedContentFromParams<NonNullable<Params>>

Parameters

completion: ChatCompletion
params: Params

Returns

ParsedChatCompletion<ParsedT>