Skip to main content

Module tools

Module tools 

Source
Expand description

OpenAI-style tool-call emulation.

Venice E2EE responses do not expose native function calls, so this module parses tool calls client-side from decrypted assistant text using a vendored subset of vLLM’s Rust tool parser, validates the calls against the request’s OpenAI tools, and builds prompt text for the encrypted controller/correction requests.

Venice E2EE cannot render tools into the server-side chat template (tools arrive encrypted), so the proxy prompt must instruct a model-visible output shape. Use model-family-specific shapes where the bundled vLLM Rust parser has a matching format, and fall back to Hermes JSON otherwise.

Structs§

ToolCallValidationError
Validation error for parsed assistant tool-call output.
ToolEmulationContext
Per-request tool-emulation state derived from config, tools, and tool choice.
ValidatedToolCall
OpenAI-compatible tool call validated against the request’s available tools.

Enums§

ToolOutputClassification
Classification of a decrypted assistant response under tool emulation.

Functions§

generate_tool_call_id
Generates an OpenAI-style tool-call ID.