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

x/openai/resources/beta/threads/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.53.2/resources/beta/threads/mod.ts";

Namespaces

Interfaces

An object describing the expected output of the model. If json_object only function type tools are allowed to be passed to the Run. If text the model can return text or any value needed.

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

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.

A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.

A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.

References an image File in the content of a message.

References an image File in the content of a message.

References an image URL in the content of a message.

References an image URL in the content of a message.

Represents a message within a thread.

On an incomplete message, details about why the message is incomplete.

The delta containing the fields that have changed on the Message.

Represents a message delta i.e. any changed fields on a message during streaming.

Tool call objects

The function definition.

Represents an execution run on a thread.

Details on why the run is incomplete. Will be null if the run is not incomplete.

The last error associated with this run. Will be null if there are no errors.

Details on the action required to continue the run. Will be null if no action is required.

Details on the tool outputs needed for this run to continue.

Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.

Usage statistics related to the run. This value will be null if the run is not in a terminal state (i.e. in_progress, queued, etc.).

Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.

Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.

Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.

Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.

The text content that is part of a message.

The text content that is part of a message.

The text content that is part of a message.

Represents a thread that contains messages.

A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

If no thread is provided, an empty thread will be created.

A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

The default strategy. This strategy currently uses a max_chunk_size_tokens of 800 and chunk_overlap_tokens of 400.

A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.

If no thread is provided, an empty thread will be created.

A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.

If no thread is provided, an empty thread will be created.

A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.

A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

The default strategy. This strategy currently uses a max_chunk_size_tokens of 800 and chunk_overlap_tokens of 400.

A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

Type Aliases

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.

Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, and all GPT-3.5 Turbo models since gpt-3.5-turbo-1106.

Controls which (if any) tool is called by the model. none means the model will not call any tools and instead generates a message. auto is the default value and means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools before responding to the user. Specifying a particular tool like {"type": "file_search"} or {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.

References an image File in the content of a message.

References an image File in the content of a message.

References an image File in the content of a message.

The status of the run, which can be either queued, in_progress, requires_action, cancelling, cancelled, failed, completed, incomplete, or expired.