Skip to content

vox-openai API Reference (generated)

Crate: vox-openai · Version: 0.6.0 · Target: Library (lib.rs)

OpenAI-compatible chat completions JSON types (wire and SSE streaming).

OpenAI-compatible non-streaming chat completion JSON shapes (/v1/chat/completions).

Streaming (text/event-stream) line assembly lives in vox-openai-sse.

ModuleDescription
sse—
Dependency Topology, diagram 15 nodes, 4 edges: vox-actor-runtime → vox-openai; vox-gamify → vox-openai; vox-llm-egress → vox-openai; vox-orchestrator-mcp → vox-openaivox-openaivox-actor-runtimevox-gamifyvox-llm-egressvox-orchestrator-mcp
Diagram source
graph {
direction: right
node vox_openai: "vox-openai"
node vox_actor_runtime: "vox-actor-runtime"
vox_actor_runtime -> vox_openai
node vox_gamify: "vox-gamify"
vox_gamify -> vox_openai
node vox_llm_egress: "vox-llm-egress"
vox_llm_egress -> vox_openai
node vox_orchestrator_mcp: "vox-orchestrator-mcp"
vox_orchestrator_mcp -> vox_openai
}
Consumer CrateRole
vox-actor-runtimeDirect workspace dependent
vox-gamifyDirect workspace dependent
vox-llm-egressDirect workspace dependent
vox-orchestrator-mcpDirect workspace dependent
KindSymbolSignatureSourceDescription
structsse::Utf8LineBufferpub struct Utf8LineBuffercrates/vox-openai/src/sse.rs#L12-L14Accumulates UTF-8 chunks and invokes on_line for each newline-delimited line (CR stripped).
fnsse::newpub fn new() -> Selfcrates/vox-openai/src/sse.rs#L18-L20—
fnsse::push_lossy_bytespub fn push_lossy_bytes(&mut self, bytes: &[u8], mut on_line: impl FnMut(&str))crates/vox-openai/src/sse.rs#L23-L30Push lossy-decoded bytes and emit complete lines.
fnsse::flush_trailingpub fn flush_trailing(&mut self, mut on_line: impl FnMut(&str))crates/vox-openai/src/sse.rs#L33-L39Invoke on_line on any trailing fragment that did not end with \n, then clear.
fnsse::chat_completion_delta_contentpub fn chat_completion_delta_content(data: &str) -> Option<String>crates/vox-openai/src/sse.rs#L44-L49Parse data JSON from one SSE data: … line (after the data: prefix) and return delta content, if any.
structsse::ToolCallDeltapub struct ToolCallDeltacrates/vox-openai/src/sse.rs#L53-L58Incremental tool-call delta fragment from an OpenAI-compatible SSE delta.tool_calls[i] object.
structsse::SseDeltaEventpub struct SseDeltaEventcrates/vox-openai/src/sse.rs#L62-L68Parsed content, tool-call fragments, and/or final-chunk usage telemetry from a single SSE data: {json} frame.
fnsse::is_emptypub fn is_empty(&self) -> boolcrates/vox-openai/src/sse.rs#L72-L78—
fnsse::sse_data_line_delta_eventpub fn sse_data_line_delta_event(line: &str) -> Option<SseDeltaEvent>crates/vox-openai/src/sse.rs#L83-L167Parse one SSE data: {json} line into content, delta.tool_calls, and/or usage telemetry.
fnsse::sse_data_line_deltapub fn sse_data_line_delta(line: &str) -> Option<String>crates/vox-openai/src/sse.rs#L171-L182One SSE line: data: {json} → non-empty delta content; [DONE], blanks, and non-data: lines → None.