Skip to main content

Module pb

Module pb 

Source
Expand description

Prost-generated typed model, compiled from proto/llmleaf/v1/llmleaf.proto by build.rs. This is the “real codegen” proof: the proto genuinely compiles into the crate and the generated messages are available here as a typed mirror.

These types are NOT what the SDK serialises onto the wire — prost emits protobuf-binary-shaped types (oneofs, i32 enums, no OpenAI JSON casing). The wire uses the hand-written serde structs in [crate::types]. Use this module when you want the canonical proto representation (e.g. to interop with a protobuf toolchain).

Modules§

chat_message
Nested message and enum types in ChatMessage.
content_part
Nested message and enum types in ContentPart.
response_content_part
Nested message and enum types in ResponseContentPart.
response_item
Nested message and enum types in ResponseItem.
response_message_item
Nested message and enum types in ResponseMessageItem.
responses_request
Nested message and enum types in ResponsesRequest.
responses_tool_choice
Nested message and enum types in ResponsesToolChoice.
tool_choice
Nested message and enum types in ToolChoice.

Structs§

Architecture
BatchCounts
BatchCreateRequest
BatchError
BatchHandle
BatchRequestItem
BatchResponse
BatchResultLine
One line of the JSONL results stream (GET /v1/batches/{id}/results).
ChatCompletionChunk
ChatMessage
ChatRequest
ChatResponse
Choice
ChunkChoice
ContentPart
A single content part for multimodal messages: {“type”:“text”,“text”:“…”} {“type”:“image_url”,“image_url”:{“url”:“…”,“detail”:“auto”}}
ContentParts
Delta
Streaming SSE frame: data: <ChatCompletionChunk JSON>\n\n, terminated by the sentinel line data: \[DONE\].
Embedding
EmbeddingRequest
EmbeddingResponse
ErrorBody
ErrorResponse
The canonical error envelope returned by every endpoint: {“error”:{“message”:…}}.
FunctionCall
A function the model called. arguments is a JSON-encoded string (OpenAI shape).
FunctionCallDelta
Incremental tool-call fragment on a streaming delta; fields arrive piecemeal.
FunctionDef
A function the model MAY call. parameters is a raw JSON Schema string.
FunctionName
ImageUrlPart
ListModelsResponse
ModelEndpoint
Admin-only fallback-chain entry (present only with a valid x-admin-token).
ModelEntry
NamedToolChoice
Pricing
PromptTokensDetails
Breakdown of Usage.prompt_tokens. Today only the cached (cache-read / hit) share is surfaced — the count of prompt tokens served from the provider’s cache rather than processed fresh.
ReasoningDetail
One structured reasoning (“thinking”) block, OpenRouter-shaped (message.reasoning_details\[\] / delta.reasoning_details\[\]). It expresses both open reasoning (visible text, optionally signed) and hidden reasoning (an encrypted/redacted blob the provider returns in place of the text). type is the wire discriminator and selects which field is set: “reasoning.text” -> text (+ optional signature) — OPEN (visible reasoning) “reasoning.summary” -> summary — OPEN (a summarised view) “reasoning.encrypted” -> data — HIDDEN (redacted / opaque) signature and data are opaque to the client and MUST be echoed back verbatim in the next request’s reasoning_details to continue a signed/encrypted reasoning turn (the upstream rejects an altered or dropped block — e.g. before a tool call). format tags the provider encoding when known.
RerankRequest
RerankResponse
RerankResult
ResponseContentPart
One content part; the "type" wire token matches the set field’s name: {“type”:“input_text”,“text”:…} {“type”:“input_image”,“image_url”:“”,“detail”:…} (image_url is a STRING here) {“type”:“output_text”,“text”:…,“annotations”:[]}
ResponseContentParts
ResponseFormat
response_format: {“type”:“text”|“json_object”|“json_schema”, “json_schema”: {…}}
ResponseFunctionCallItem
A function call the model made. call_id pairs it with its function_call_output; arguments is the raw JSON string exactly as emitted.
ResponseFunctionCallOutputItem
The caller’s answer to a function call, replayed on the next turn.
ResponseInputImagePart
ResponseItem
One item of the request input array or the response output array. The wire discriminator is "type" and selects which field is set: “message” -> message (also the shape of a role-keyed item with no type) “function_call” -> function_call “function_call_output” -> function_call_output “reasoning” -> reasoning
ResponseItemList
ResponseMessageItem
A conversation message item. On input, role is “user” | “system” | “developer” | “assistant” and content is a bare string or input parts; on output, role is “assistant”, content is output_text parts, and status/id are set.
ResponseReasoningItem
A reasoning (“thinking”) item. summary entries are {“type”:“summary_text”,“text”}, content entries are {“type”:“reasoning_text”,“text”} — the entry’s list decides its wire type token. encrypted_content is opaque and MUST be echoed back verbatim in the next request’s input to continue an encrypted reasoning turn (llmleaf requests it from Responses-speaking upstreams so multi-turn reasoning survives statelessly).
ResponseReasoningText
ResponseTextPart
ResponsesIncompleteDetails
status “incomplete” refinement: “max_output_tokens” | “content_filter”.
ResponsesInputTokensDetails
ResponsesNamedToolChoice
ResponsesOutputTokensDetails
ResponsesReasoning
reasoning: {“effort”:“minimal”|“low”|“medium”|“high”|…, “summary”:…}
ResponsesRequest
ResponsesResponse
The response object ("object":"response"), also the snapshot carried by the response.created / response.in_progress / response.completed stream events. Fields the wire echoes but SDKs don’t need typed (tools, tool_choice, truncation, parallel_tool_calls, …) are simply ignored on decode — JSON tolerates unknown keys.
ResponsesStreamEvent
One streaming SSE event. Unlike chat streaming there is NO data: \[DONE\] sentinel: each frame is event: <type> + data: <json> where the JSON is self-describing via type, and the stream ends after the terminal response.completed / response.incomplete / response.failed event. This is a flat superset of every event’s fields — type says which ones are meaningful; SDKs MUST ignore event types they don’t recognise (the dialect grows by adding types).
ResponsesToolChoice
tool_choice: a mode string (“auto”|“none”|“required”) or the FLAT named object {“type”:“function”,“name”:“…”} (no nested function, unlike the chat dialect).
ResponsesToolDef
A tool the model MAY call — FLAT in this dialect (type/name/parameters at the top level, no nested function object). parameters is a raw JSON Schema string.
ResponsesUsage
Token accounting in the Responses dialect’s own names (input_tokens/output_tokens, not the chat dialect’s prompt_tokens/completion_tokens).
SpeechRequest
TextPart
ToolCall
ToolCallDelta
ToolChoice
tool_choice is either a mode string (“auto”|“none”|“required”) or an object pinning a specific function: {“type”:“function”,“function”:{“name”:“…”}}.
ToolDef
TopProvider
TranscriptionRequest
The audio file itself is sent as the multipart file part, NOT in this message; these are the accompanying form fields.
TranscriptionResponse
For response_format json/verbose_json. text/srt/vtt return a plain-text body.
Usage
Token accounting echoed on every response. cost_usd is an llmleaf addition (real-time price from the bundled pricing dataset); it is null/absent when the model has no known price.
Voice
VoicesResponse

Enums§

BatchStatus
FinishReason
Role