Skip to main content

generate_title

Function generate_title 

Source
pub async fn generate_title(
    __arg0: State<UnifiedAppState>,
    __arg1: Json<GenerateTitleRequest>,
) -> Result<Json<GenerateTitleResponse>, (StatusCode, Json<ErrorResponse>)>
Expand description

Generate a concise chat title (1-5 words) from a user prompt.

  • Offline mode (no api_key/model_id): uses the local LLM worker directly.
  • Online mode (api_key + model_id present): proxies to OpenRouter on behalf of the frontend. The frontend must NOT call OpenRouter directly — Tauri’s CSP blocks external connect-src origins from the WebView.