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
- Batch
Counts - Batch
Create Request - Batch
Error - Batch
Handle - Batch
Request Item - Batch
Response - Batch
Result Line - One line of the JSONL results stream (GET /v1/batches/{id}/results).
- Chat
Completion Chunk - Chat
Message - Chat
Request - Chat
Response - Choice
- Chunk
Choice - Content
Part - A single content part for multimodal messages: {“type”:“text”,“text”:“…”} {“type”:“image_url”,“image_url”:{“url”:“…”,“detail”:“auto”}}
- Content
Parts - Delta
- Streaming SSE frame:
data: <ChatCompletionChunk JSON>\n\n, terminated by the sentinel linedata: \[DONE\]. - Embedding
- Embedding
Request - Embedding
Response - Error
Body - Error
Response - The canonical error envelope returned by every endpoint: {“error”:{“message”:…}}.
- Function
Call - A function the model called.
argumentsis a JSON-encoded string (OpenAI shape). - Function
Call Delta - Incremental tool-call fragment on a streaming delta; fields arrive piecemeal.
- Function
Def - A function the model MAY call.
parametersis a raw JSON Schema string. - Function
Name - Image
UrlPart - List
Models Response - Model
Endpoint - Admin-only fallback-chain entry (present only with a valid x-admin-token).
- Model
Entry - Named
Tool Choice - Pricing
- Prompt
Tokens Details - 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. - Reasoning
Detail - 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).typeis 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)signatureanddataare 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).formattags the provider encoding when known. - Rerank
Request - Rerank
Response - Rerank
Result - Response
Content Part - 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”:[]} - Response
Content Parts - Response
Format - response_format: {“type”:“text”|“json_object”|“json_schema”, “json_schema”: {…}}
- Response
Function Call Item - A function call the model made.
call_idpairs it with its function_call_output;argumentsis the raw JSON string exactly as emitted. - Response
Function Call Output Item - The caller’s answer to a function call, replayed on the next turn.
- Response
Input Image Part - Response
Item - One item of the request
inputarray or the responseoutputarray. 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 - Response
Item List - Response
Message Item - A conversation message item. On input,
roleis “user” | “system” | “developer” | “assistant” andcontentis a bare string or input parts; on output, role is “assistant”, content is output_text parts, andstatus/idare set. - Response
Reasoning Item - A reasoning (“thinking”) item.
summaryentries are {“type”:“summary_text”,“text”},contententries are {“type”:“reasoning_text”,“text”} — the entry’s list decides its wiretypetoken.encrypted_contentis 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). - Response
Reasoning Text - Response
Text Part - Responses
Incomplete Details - status “incomplete” refinement: “max_output_tokens” | “content_filter”.
- Responses
Input Tokens Details - Responses
Named Tool Choice - Responses
Output Tokens Details - Responses
Reasoning - reasoning: {“effort”:“minimal”|“low”|“medium”|“high”|…, “summary”:…}
- Responses
Request - Responses
Response - The response object (
"object":"response"), also the snapshot carried by theresponse.created/response.in_progress/response.completedstream 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. - Responses
Stream Event - One streaming SSE event. Unlike chat streaming there is NO
data: \[DONE\]sentinel: each frame isevent: <type>+data: <json>where the JSON is self-describing viatype, and the stream ends after the terminalresponse.completed/response.incomplete/response.failedevent. This is a flat superset of every event’s fields —typesays which ones are meaningful; SDKs MUST ignore event types they don’t recognise (the dialect grows by adding types). - Responses
Tool Choice - tool_choice: a mode string (“auto”|“none”|“required”) or the FLAT named object
{“type”:“function”,“name”:“…”} (no nested
function, unlike the chat dialect). - Responses
Tool Def - A tool the model MAY call — FLAT in this dialect (
type/name/parametersat the top level, no nestedfunctionobject).parametersis a raw JSON Schema string. - Responses
Usage - Token accounting in the Responses dialect’s own names (
input_tokens/output_tokens, not the chat dialect’sprompt_tokens/completion_tokens). - Speech
Request - Text
Part - Tool
Call - Tool
Call Delta - Tool
Choice - tool_choice is either a mode string (“auto”|“none”|“required”) or an object pinning a specific function: {“type”:“function”,“function”:{“name”:“…”}}.
- ToolDef
- TopProvider
- Transcription
Request - The audio file itself is sent as the multipart
filepart, NOT in this message; these are the accompanying form fields. - Transcription
Response - For response_format json/verbose_json. text/srt/vtt return a plain-text body.
- Usage
- Token accounting echoed on every response.
cost_usdis an llmleaf addition (real-time price from the bundled pricing dataset); it is null/absent when the model has no known price. - Voice
- Voices
Response