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§
- Accumulated
Tool Call - An accumulated tool call from streaming.
- Batch
- A batch job returned by the gateway.
- Batch
Request Counts - Request counts for a batch job.
- Batch
Request Item - A single request within a batch.
- Batch
Result - The results of a completed batch job.
- Batch
Result Error - An error for a single request within a batch.
- Batch
Result Item - The result of a single request within a batch.
- Chat
Completion - A chat completion response.
- Chat
Completion Chunk - A streaming chunk of a chat completion.
- Chat
Completion Message - A message in a completion response.
- Choice
- A choice in a completion response.
- Choice
Delta - A delta (partial update) in a streaming response.
- Chunk
Accumulator - Accumulator for streaming chunks into a complete response.
- Chunk
Choice - A choice in a streaming chunk.
- Completion
Params - Parameters for a completion request.
- Completion
Usage - Token usage statistics for a completion.
- Create
Batch Params - Parameters for creating a batch job.
- Function
- A function call with name and arguments.
- Function
Delta - A partial function call delta for streaming.
- Image
Url - An image URL reference.
- List
Batches Options - Options for listing batch jobs.
- Message
- A message in a conversation.
- Moderation
Image Url - An image URL reference for a moderation content part.
- Moderation
Params - Parameters for a moderation request.
- Moderation
Response - Top-level moderation response (OpenAI-compatible shape).
- Moderation
Result - A single moderation result.
- Reasoning
- Extended thinking/reasoning content.
- Rerank
Meta - Provider-specific billing metadata.
- Rerank
Params - Parameters for a rerank request.
- Rerank
Response - Normalized rerank response, provider-agnostic.
- Rerank
Result - A single reranked document score.
- Rerank
Usage - Normalized token usage for a rerank request.
- Tool
- A tool that can be called by the model.
- Tool
Builder - Builder for creating tools.
- Tool
Call - A tool call made by the model.
- Tool
Call Delta - A partial tool call delta for streaming.
- Tool
Choice Function - A specific function to force the model to use.
- Tool
Function - A function that can be called.
Enums§
- Batch
Status - Status of a batch job.
- Content
- Content of a message - can be simple text or multiple parts.
- Content
Part - A part of multi-part content.
- Moderation
Content Part - A single multimodal content part for moderation input.
- Moderation
Input - Input to a moderation request.
- Reasoning
Effort - The level of reasoning effort for models that support extended thinking.
- Role
- The role of a message in a conversation.
- Stop
Sequence - Stop sequence - can be a single string or multiple strings.
- Tool
Choice - How the model should choose which tool to use.
Type Aliases§
- Completion
Stream - A stream of completion chunks.