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

x/openai/resources/mod.ts

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
import * as openai from "https://deno.land/x/openai@v4.24.4/resources/mod.ts";

Classes

Note: no pagination actually occurs yet, this is for forwards-compatibility.

Note: no pagination actually occurs yet, this is for forwards-compatibility.

Note: no pagination actually occurs yet, this is for forwards-compatibility.

Interfaces

Represents a chat completion response returned by model, based on the provided input.

Log probability information for the choice.

Deprecated and replaced by tool_calls. The name and arguments of a function that should be called, as generated by the model.

Represents a streamed chunk of a chat completion response returned by model, based on the provided input.

A chat completion delta generated by streamed model responses.

Deprecated and replaced by tool_calls. The name and arguments of a function that should be called, as generated by the model.

Log probability information for the choice.

An object specifying the format that the model must output. Compatible with gpt-4-1106-preview and gpt-3.5-turbo-1106.

Specifying a particular function via {"name": "my_function"} forces the model to call that function.

A chat completion message generated by the model.

Deprecated and replaced by tool_calls. The name and arguments of a function that should be called, as generated by the model.

The function that the model called.

Specifies a tool the model should use. Use to force the model to call a specific function.

Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).

Usage statistics for the completion request.

The usage information for the request.

Represents an embedding vector returned by embedding endpoint.

The File object represents a document that has been uploaded to OpenAI.

The FineTune object represents a legacy fine-tune job that has been created through the API.

The hyperparameters used for the fine-tuning job. See the fine-tuning guide for more details.

The hyperparameters used for the fine-tuning job.

Fine-tune event object

Represents the url or the content of an image generated by the OpenAI API.

Describes an OpenAI model offering that can be used with the API.

A list of the categories, and whether they are flagged or not.

A list of the categories along with their scores as predicted by model.

Represents policy compliance report by OpenAI's content moderation model against a given input.

Type Aliases

The role of the author of a message

Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. Specifying a particular function via {"type: "function", "function": {"name": "my_function"}} forces the model to call that function.

The parameters the functions accepts, described as a JSON Schema object. See the guide for examples, and the JSON Schema reference for documentation about the format.