Skip to main content

build_chat_request

Function build_chat_request 

Source
pub fn build_chat_request(
    model: impl Into<String>,
    model_provider: impl Into<String>,
    system_prompt: Option<String>,
    messages: Vec<ChatMessage>,
    tools: Vec<Value>,
    reasoning_effort: Option<String>,
) -> ChatRequest
Expand description

Build a ChatRequest from already-assembled prompt + history. The function is pure and deterministic: same inputs → same JSON bytes. Both the TUI engine (handle_deepseek_turn / refresh_system_prompt) and the headless exec call this, so the parity invariant is structural, not best-effort.