(format: RequestFormat, body: &Value, path: &str)
| 508 | } |
| 509 | |
| 510 | fn parse_request(format: RequestFormat, body: &Value, path: &str) -> Result<InternalRequest> { |
| 511 | let body = body |
| 512 | .as_object() |
| 513 | .ok_or_else(|| anyhow!("request body must be an object"))?; |
| 514 | match format { |
| 515 | RequestFormat::OpenAiChat => parse_openai_chat(body), |
| 516 | RequestFormat::ClaudeChat => parse_claude_chat(body), |
| 517 | RequestFormat::OpenAiResponses => parse_openai_responses(body), |
| 518 | RequestFormat::GeminiChat => parse_gemini_chat(body, path), |
| 519 | } |
| 520 | } |
| 521 | |
| 522 | fn emit_request(format: RequestFormat, req: &InternalRequest) -> Result<Value> { |
| 523 | Ok(match format { |
no test coverage detected