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

x/openai/resources/mod.ts>Completions

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
class Completions
extends APIResource
import { Completions } from "https://deno.land/x/openai@v4.33.1/resources/mod.ts";

Methods

create(body: ChatCompletionCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<ChatCompletion>

Creates a model response for the given chat conversation.

create(body: ChatCompletionCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<ChatCompletionChunk>>
create(body: ChatCompletionCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<ChatCompletionChunk> | ChatCompletion>

Methods

create(body: CompletionCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<Completion>

Creates a completion for the provided prompt and parameters.

create(body: CompletionCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<Completion>>
create(body: CompletionCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<Completion> | Completion>