Module async_openai::types
source · Expand description
Types used in OpenAI API requests and responses. These types are created from component schemas in the OpenAPI spec
Structs§
- A list of Files attached to an
assistant. - Represents an
assistantthat can call the model and use tools. - Retrieval tool
- Function tool
- An object describing the expected output of the model. If
json_objectonlyfunctiontypetoolsare allowed to be passed to the Run. Iftextthe 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.
- 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 their scores as predicted by model.
- ChatCompletionFunctionsDeprecated
- 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
ChatCompletionRequestFunctionMessage. - Builder for
ChatCompletionRequestMessageContentPartImage. - 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. - 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. - 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.
- 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. - 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.
- Builder for
ModifyAssistantRequest. - The
Fileobject represents a document that has been uploaded to OpenAI. - 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
- 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. - 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. - 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.
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.