Skip to main content

Module types

Module types 

Source
Expand description

Type definitions for otari.

This module contains all the core types used throughout the library, designed to be compatible with the OpenAI API format while supporting extensions for other providers.

Structs§

AccumulatedToolCall
An accumulated tool call from streaming.
Batch
A batch job returned by the gateway.
BatchRequestCounts
Request counts for a batch job.
BatchRequestItem
A single request within a batch.
BatchResult
The results of a completed batch job.
BatchResultError
An error for a single request within a batch.
BatchResultItem
The result of a single request within a batch.
ChatCompletion
A chat completion response.
ChatCompletionChunk
A streaming chunk of a chat completion.
ChatCompletionMessage
A message in a completion response.
Choice
A choice in a completion response.
ChoiceDelta
A delta (partial update) in a streaming response.
ChunkAccumulator
Accumulator for streaming chunks into a complete response.
ChunkChoice
A choice in a streaming chunk.
CompletionParams
Parameters for a completion request.
CompletionUsage
Token usage statistics for a completion.
CreateBatchParams
Parameters for creating a batch job.
Function
A function call with name and arguments.
FunctionDelta
A partial function call delta for streaming.
ImageUrl
An image URL reference.
ListBatchesOptions
Options for listing batch jobs.
Message
A message in a conversation.
ModerationImageUrl
An image URL reference for a moderation content part.
ModerationParams
Parameters for a moderation request.
ModerationResponse
Top-level moderation response (OpenAI-compatible shape).
ModerationResult
A single moderation result.
Reasoning
Extended thinking/reasoning content.
RerankMeta
Provider-specific billing metadata.
RerankParams
Parameters for a rerank request.
RerankResponse
Normalized rerank response, provider-agnostic.
RerankResult
A single reranked document score.
RerankUsage
Normalized token usage for a rerank request.
Tool
A tool that can be called by the model.
ToolBuilder
Builder for creating tools.
ToolCall
A tool call made by the model.
ToolCallDelta
A partial tool call delta for streaming.
ToolChoiceFunction
A specific function to force the model to use.
ToolFunction
A function that can be called.

Enums§

BatchStatus
Status of a batch job.
Content
Content of a message - can be simple text or multiple parts.
ContentPart
A part of multi-part content.
ModerationContentPart
A single multimodal content part for moderation input.
ModerationInput
Input to a moderation request.
ReasoningEffort
The level of reasoning effort for models that support extended thinking.
Role
The role of a message in a conversation.
StopSequence
Stop sequence - can be a single string or multiple strings.
ToolChoice
How the model should choose which tool to use.

Type Aliases§

CompletionStream
A stream of completion chunks.