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. - Code interpreter tool
- Function tool
- Retrieval tool
- A list of the categories along with their scores as predicted by model.
- 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.
- 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
CreateEditRequest. - Builder for
CreateEmbeddingRequest. - Builder for
CreateFileRequest. - Builder for
CreateFineTuneRequest. - Builder for
CreateFineTuningJobRequest. - Builder for
CreateImageEditRequest. - Builder for
CreateImageRequest. - Builder for
CreateImageVariationRequest. - Builder for
CreateMessageRequest. - Builder for
CreateModerationRequest. - Represents policy compliance report by OpenAI’s content moderation model against a given input.
- Builder for
CreateRunRequest. - Builder for
CreateSpeechRequest. - Builder for
CreateThreadAndRunRequest. - Builder for
CreateThreadRequest. - Builder for
CreateTranscriptionRequest. - Builder for
CreateTranslationRequest. - 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. - Fine-tuning job event object
- The name and arguments of a function that should be called, as generated by the model.
- Builder for
ImageUrl. - References an image File in the content of a message.
- The text content that is part of a message.
- 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.
- 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.
- Details of the tool call.
- Represents a step in execution of a run.
- Represents a thread that contains messages.
- Builder for
ToolsOutputs.
Enums
- Controls which (if any) function is called by the model.
nonemeans the model will not call a function and instead generates a message.automeans 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.noneis the default when no functions are present.autois the default if functions are present.
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.
- Parsed server side events stream until an [DONE] is received from server.