Skip to main content

parse_response

Function parse_response 

Source
pub fn parse_response(value: &Value) -> ChatResponse
Expand description

Parse a full (non-streaming) Mistral chat-completion response.

The response shape (id, model, choices[0].message.{content,tool_calls}, choices[0].finish_reason, usage.{prompt_tokens,completion_tokens,total_tokens}) is identical to OpenAI’s, so parsing is reused verbatim.