Aller au contenu principal

Handler for `POST /api/v1/llm/complete`.

POST 

/api/v1/llm/complete

Accepts a multi-turn conversation history and dispatches it through LlmRouter::complete_with_observability. Each MessageDto is mapped to a ChatMessage based on its role field:

  • "system" → ChatMessage::system
  • "user" → ChatMessage::user
  • "assistant" → ChatMessage::assistant
  • "tool" → ChatMessage::tool_result (empty call id)

Returns 400 Bad Request when an unknown role is encountered. Returns 503 Service Unavailable when no router is configured or the call fails.

Request​

Responses​

Completion result