Module chat_completion

Source
Expand description

Module for handling chat completion requests and responses. This module defines the structures and methods for handling chat completion requests and responses. It includes the ChatCompletionRequest, ChatCompletionResponse, ChatCompletionMessage, ChatCompletionChoice, Function, FunctionParameters, JSONSchemaType, JSONSchemaDefine, FinishReason, FinishDetails, ToolCall, ToolCallFunction, and Tool structs along with their associated methods. These structures facilitate the creation, serialization, and deserialization of chat completion requests and responses in various formats, allowing for customizable and extensible interactions with chat models.

Structs§

ChatCompletionChoice
Represents a choice in a chat completion response.
ChatCompletionMessage
Represents a chat completion message.
ChatCompletionMessageForResponse
Represents a chat completion message for a response.
ChatCompletionRequest
Represents a request for chat completion.
ChatCompletionResponse
Represents a chat completion response.
FinishDetails
Additional details for the finish reason.
Function
Represents a function definition.
FunctionParameters
Represents the parameters of a function using JSON schema.
ImageUrl
Represents an image URL.
ImageUrlType
Represents the URL of an image.
JSONSchemaDefine
Defines the structure of a JSON schema.
Tool
Represents a tool in the request.
ToolCall
Represents a tool call in the chat completion response.
ToolCallFunction
Represents a function associated with a tool call.

Enums§

Content
Represents the content of a message.
ContentType
Represents the type of content.
FinishReason
Reason for finishing the response.
JSONSchemaType
Represents the JSON schema type.
ToolChoiceType
Represents the type of tool choice in the request.
ToolType
Enum for different types of tools.