types library

Classes

ChatCompletion
A complete Chat Completion response (non-streaming). Mirrors OpenAI chat.completion.
ChatCompletionChoice
ChatCompletionChunk
A single Chat Completion chunk (streaming). Mirrors OpenAI chat.completion.chunk.
ChatCompletionChunkChoice
ChatCompletionChunkFunction
ChatCompletionChunkToolCall
A tool call delta in a ChatCompletionChunk.
ChatCompletionDelta
ChatCompletionFunction
ChatCompletionMessage
ChatCompletionToolCall
A tool call in a ChatCompletionMessage.
ChatCompletionUsage
Token usage statistics (shared by streaming and non-streaming).
CompletionTokensDetails
ContentPart
ContentPartFile
ContentPartFileBase64
ContentPartFileReference
ContentPartFileUrl
ContentPartImage
ContentPartReasoning
ContentPartText
ContentPartToolCall
ContentPartToolResult
ContentPartUnknown
FileBytes
FileBytesBase64
FileBytesBinary
FileData
FileDataData
FileDataReference
FileDataText
FileDataUrl
FinishReason
Why generation stopped. Mirrors FinishReason.ts.
FunctionTool
A function tool definition. Mirrors FunctionTool.ts.
GenerateContent
A content item in a GenerateResult. Mirrors GenerateContent.ts (aimux-core/src/result.rs).
GenerateContentFile
A file generated by the model (e.g. an image or document). The data field is a FileData tagged union; there is no filename field.
GenerateContentReasoning
A reasoning / thinking segment produced by the model.
GenerateContentSource
A source / citation (e.g. URL citation from search-preview models).
GenerateContentText
Generated text.
GenerateContentToolCall
A tool call requested by the model.
GenerateContentToolResult
A tool result from a provider-executed tool (e.g. xAI file_search, web_search). Emitted alongside the preceding ToolCall.
GenerateContentUnknown
Fallback for unknown/forward-compatible GenerateContent variants.
GenerateObjectResult
Result of generate_object (user-facing, M12). The parsed JSON object plus convenience fields from the underlying generate_text call.
GenerateResult
GenerateTextOptions
User-facing options for generate_text / stream_text. Mirrors GenerateTextOptions.ts.
GenerateTextResult
Result of generate_text (user-facing). Mirrors GenerateTextResult.ts.
ModelMessage
A single user-facing chat message. Mirrors ModelMessage.ts.
PromptTokensDetails
ResponseMetadata
StreamPart
A single chunk in the stream returned by stream_text. Mirrors StreamPart.ts (aimux-core/src/stream_part.rs).
StreamPartError
An error occurred mid-stream.
StreamPartFile
A file generated by the model (e.g. an image or document). The data field is a FileData tagged union; there is no filename field.
StreamPartFinish
Final chunk — carries usage, finish reason, and metadata.
StreamPartRaw
A raw chunk from the provider (for debugging, when include_raw_chunks is set).
StreamPartReasoningDelta
A delta of a reasoning / thinking segment.
StreamPartReasoningEnd
End of a reasoning / thinking segment.
StreamPartReasoningStart
Start of a reasoning / thinking segment.
StreamPartResponseMetadata
Response metadata (id, timestamp, model_id).
StreamPartSource
A source / citation (e.g. URL citation from search-preview models).
StreamPartStreamStart
First chunk — carries warnings from the provider.
StreamPartTextDelta
A delta of generated text.
StreamPartTextEnd
End of a text segment.
StreamPartTextStart
Start of a text segment.
StreamPartToolCall
A complete tool call (alternative to the start/delta/end flow).
StreamPartToolInputDelta
A delta of tool call input (partial JSON).
StreamPartToolInputEnd
End of a tool call's input streaming.
StreamPartToolInputStart
Start of a tool call's input streaming.
StreamPartToolResult
A tool result (provider-executed tools).
StreamPartUnknown
Fallback for unknown/forward-compatible StreamPart variants.
StreamTextResultAggregated
Aggregated result of stream_text().consume() (M11). Mirrors GenerateTextResult's user-facing fields (without raw, since streaming has no GenerateResult equivalent).
TimeoutConfiguration
Per-call timeout configuration. Mirrors TimeoutConfiguration.ts.
TokenUsage
Token usage detail (with cache breakdown). Mirrors TokenUsage.ts.
Tool
A tool definition: function or provider tool. Mirrors Tool.ts.
ToolCall
A tool call requested by the model. Mirrors ToolCall.ts.
ToolChoice
How the model should choose tools. Mirrors ToolChoice.ts.
Usage
Token usage statistics. Mirrors Usage.ts.