Expand description
Types used in OpenAI API requests and responses. These types are created from component schemas in the OpenAPI spec
Modules§
- realtime
realtime
Structs§
- Request parameters for adding a part to an Upload
- A list of Files attached to an
assistant. - Represents an
assistantthat can call the model and use tools. - Retrieval tool
- Function tool
- Specifies a tool the model should use. Use to force the model to call a specific tool.
- A log of a user action or configuration change within this organization.
- The actor who performed the audit logged action.
- The API Key used to perform the audit logged action.
- The service account that performed the audit logged action.
- The session in which the audit logged action was performed.
- The user who performed the audit logged action.
- The details for events with the type
api_key.created. - The payload used to create the API key.
- The details for events with the type
api_key.deleted. - The details for events with the type
api_key.updated. - The payload used to update the API key.
- The details for events with the type
invite.accepted. - The details for events with the type
invite.deleted. - The details for events with the type
invite.sent. - The payload used to create the invite.
- The details for events with the type
login.failed. - The details for events with the type
logout.failed. - The details for events with the type
organization.updated. - The payload used to update the organization settings.
- The organization settings.
- The project that the action was scoped to. Absent for actions not scoped to projects.
- The details for events with the type
project.archived. - The details for events with the type
project.created. - The payload used to create the project.
- The details for events with the type
project.updated. - The payload used to update the project.
- The details for events with the type
service_account.created. - The payload used to create the service account.
- The details for events with the type
service_account.deleted. - The details for events with the type
service_account.updated. - The payload used to updated the service account.
- The details for events with the type
user.added. - The payload used to add the user to the project.
- The details for events with the type
user.deleted. - The details for events with the type
user.updated. - The payload used to update the user.
- Represents an base64-encoded embedding vector returned by embedding endpoint.
- Builder for
BatchRequest. - The per-line object of the batch input file
- The per-line object of the batch output and error files
- A list of the categories along with the input type(s) that the score applies to.
- A list of the categories along with their scores as predicted by model.
- Chat
Completion Functions Deprecated - Builder for
ChatCompletionFunctions. - Specifies a tool the model should use. Use to force the model to call a specific function.
- Builder for
ChatCompletionRequestAssistantMessage. - Builder for
ChatCompletionRequestDeveloperMessage. - Builder for
ChatCompletionRequestFunctionMessage. - Learn about audio inputs.
- Builder for
ChatCompletionRequestMessageContentPartAudio. - Builder for
ChatCompletionRequestMessageContentPartImage. - Builder for
ChatCompletionRequestMessageContentPartRefusal. - Builder for
ChatCompletionRequestMessageContentPartText. - Builder for
ChatCompletionRequestSystemMessage. - Tool message
- Builder for
ChatCompletionRequestToolMessage. - Builder for
ChatCompletionRequestUserMessage. - A chat completion message generated by the model.
- Options for streaming response. Only set this when you set
stream: true. - A chat completion delta generated by streamed model responses.
- Builder for
ChatCompletionTool. - Request parameters for completing an Upload
- Breakdown of tokens used in a completion.
- Usage statistics for the completion request.
- Builder for
CreateAssistantRequest. - Builder for
CreateChatCompletionRequest. - Represents a chat completion response returned by model, based on the provided input.
- Represents a streamed chunk of a chat completion response returned by model, based on the provided input.
- Builder for
CreateCompletionRequest. - Builder for
CreateEmbeddingRequest. - Builder for
CreateFileRequest. - Builder for
CreateFineTuningJobRequest. - Builder for
CreateImageEditRequest. - Builder for
CreateImageRequest. - Builder for
CreateImageVariationRequest. - Builder for
CreateMessageRequest. - Builder for
CreateModerationRequest. - Represents if a given text input is potentially harmful.
- Builder for
CreateRunRequest. - Builder for
CreateSpeechRequest. - Builder for
CreateThreadAndRunRequest. - Builder for
CreateThreadRequest. - Builder for
CreateTranscriptionRequest. - Represents a transcription response returned by model, based on the provided input.
- Represents a verbose json transcription response returned by model, based on the provided input.
- Builder for
CreateTranslationRequest. - Request to create an upload object that can accept byte chunks in the form of Parts.
- Builder for
CreateUploadRequest. - Builder for
CreateVectorStoreFileBatchRequest. - Builder for
CreateVectorStoreFileRequest. - Builder for
CreateVectorStoreRequest. - Deletes the association between the assistant and the file, but does not delete the File object itself.
- Represents an embedding vector returned by embedding endpoint.
- The ranking options for the file search. If not specified, the file search tool will use the
autoranker and a score_threshold of 0. - For fine-tuning jobs that have
failed, this will contain more information on the cause of the failure. - The
fine_tuning.jobobject represents a fine-tuning job that has been created through the API. - The
fine_tuning.job.checkpointobject represents a model checkpoint for a fine-tuning job that is ready to use. - Fine-tuning job event object
- The name and arguments of a function that should be called, as generated by the model.
- Builder for
FunctionObject. - Builder for
ImageUrl. - Represents an individual
inviteto the organization. - Builder for
InviteRequest. - Represents a list of audit logs.
- References an image File in the content of a message.
- References an image URL in the content of a message.
- 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.
- The text content that is part of a message.
- References an image File in the content of a message.
- 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_interpretertool to generate a file. - The text content that is part of a message.
- Represents a message delta i.e. any changed fields on a message during streaming.
- A list of files attached to a
message. - Represents a message within a thread.
- Describes an OpenAI model offering that can be used with the API.
- Image URL configuration for image moderation
- Builder for
ModifyAssistantRequest. - The
Fileobject represents a document that has been uploaded to OpenAI. - Represents an individual project.
- Represents an individual API key in a project.
- Represents the response object for deleting a project API key.
- Represents the response object for listing project API keys.
- Represents the owner of a project API key.
- The project create request payload.
- Builder for
ProjectCreateRequest. - A list of Project objects.
- Represents an individual service account in a project.
- Represents the API key associated with a project service account.
- Represents the request object for creating a project service account.
- Represents the response object for creating a project service account.
- Represents the response object for deleting a project service account.
- Represents the response object for listing project service accounts.
- The project update request payload.
- Builder for
ProjectUpdateRequest. - Represents an individual user in a project.
- The project user create request payload.
- Builder for
ProjectUserCreateRequest. - Builder for
ProjectUserUpdateRequest. - Breakdown of tokens used in a completion.
- Represents an execution run on a thread.
- Represents a run step delta i.e. any changed fields on a run step during streaming.
- Details of the message creation by the run step.
- Details of the Code Interpreter tool call the run step was involved in.
- Code interpreter image output
- Text output from the Code Interpreter tool call as part of a run step.
- Function tool call
- Details of the tool call.
- Details of the message creation by the run step.
- Code interpreter tool call
- Text output from the Code Interpreter tool call as part of a run step.
- File search tool call
- A result instance of the file search.
- Details of the tool call.
- Represents a step in execution of a run.
- Static Chunking Strategy
- Represents a thread that contains messages.
- Builder for
ToolsOutputs. - Thread Truncation Controls
- Builder for
UpdateVectorStoreRequest. - The Upload object can accept byte chunks in the form of Parts.
- The upload Part represents a chunk of bytes we can add to an Upload object.
- Represents an individual
userwithin an organization. - Confirmation of the deleted user
- A list of
Userobjects. - Builder for
UserRoleUpdateRequest. - Vector store expiration policy
- A batch of files attached to a vector store.
- A vector store is a collection of processed files can be used by the
file_searchtool.
Enums§
- Represents an event emitted when streaming a Run.
- 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.
nonemeans the model will not call any tools and instead generates a message.autois the default value and means the model can pick between generating a message or calling one or more tools.requiredmeans 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. - The event type.
- Output types that you would like the model to generate for this request.
- Error type for ChatCompletionRequestMessageContentPartRefusalBuilder
- Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools. Specifying a particular tool via{"type": "function", "function": {"name": "my_function"}}forces the model to call that tool. - The method used for fine-tuning.
- The type of input that was moderated
- Content part for multi-modal moderation input
- Static predicted output content, such as the content of a text file that is being regenerated.
- The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly.
activeorarchivedownerormember- The intended purpose of the uploaded file.
- The status of an upload
Type Aliases§
- Parsed server side events stream until an [DONE] is received from server.
- Parsed server side events stream until an [DONE] is received from server.