Skip to main content

Module common

Module common 

Source

Structs§

AudioUrl
ChatLogProbsContent
CompletionTokensDetails
ContextManagementEntry
A single entry in the Responses API context_management array.
ErrorDetail
ErrorResponse
Function
FunctionCallDelta
FunctionCallResponse
FunctionChoice
Function choice specification for ToolChoice::Function
ImageUrl
InputAudio
JsonSchemaFormat
LogProbs
PromptTokenUsageInfo
Redacted
ResponsePrompt
Reference to a prompt template and its variables.
StreamOptions
StringOrArrayIter
Iterator over StringOrArray that yields string references without cloning
Tool
ToolCall
ToolCallDelta
TopLogProb
Usage
UsageInfo
Usage information (used by rerank and other endpoints)
VideoUrl

Enums§

ChatLogProbs
ContentPart
ContextManagementType
Type tag for ContextManagementEntry. Currently only compaction is defined by the spec; the enum is kept small so unknown values serde-fail (consistent with P5’s fail-fast direction).
ConversationRef
Reference to a conversation the response belongs to.
Detail
Image detail level for PromptVariableTyped::ResponseInputImage and crate::responses::ResponseContentPart::InputImage. Spec allows "low" | "high" | "auto" | "original".
FunctionCall
Deprecated function_call field from the OpenAI API. Can be "none", "auto", or {"name": "function_name"}.
InputIds
LoRAPath
LoRA adapter path - can be single path or batch of paths (SGLang extension)
PromptCacheRetention
Retention policy for prompt-cache entries on the Responses API.
PromptVariable
A prompt variable value: plain string or a typed input (text, image, file).
PromptVariableTyped
Typed prompt variable input.
ResponseFormat
StringOrArray
A type that can be either a single string or an array of strings
ToolChoice
Tool choice for both Chat Completion and Responses APIs
ToolChoiceValue
Tool choice value for simple string options
ToolReference
Tool reference for ToolChoice::AllowedTools

Traits§

GenerationRequest
Trait for unified access to generation request properties Implemented by ChatCompletionRequest, CompletionRequest, GenerateRequest, EmbeddingRequest, RerankRequest, and ResponsesRequest

Functions§

default_true
Helper function for serde default value (returns true)
default_unknown_model
Default model for endpoints where model is optional (e.g., /generate). Uses UNKNOWN_MODEL_ID so routers treat it as “any available worker.”
deserialize_null_as_false
Deserialize a bool that also accepts JSON null (mapped to false).
is_false
Helper for #[serde(skip_serializing_if = "is_false")] on default-false flags.
is_true
Helper for #[serde(skip_serializing_if = "is_true")] on default-true flags.
validate_stop
Validates stop sequences (max 4, non-empty strings) Used by both ChatCompletionRequest and ResponsesRequest