MCPcopy Create free account
hub / github.com/CassiopeiaCode/TransformVetter / parse_request

Function parse_request

tests/format_runtime.rs:510–520  ·  view source on GitHub ↗
(format: RequestFormat, body: &Value, path: &str)

Source from the content-addressed store, hash-verified

508}
509
510fn 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
522fn emit_request(format: RequestFormat, req: &InternalRequest) -> Result<Value> {
523 Ok(match format {

Callers 1

process_requestFunction · 0.70

Calls 4

parse_openai_chatFunction · 0.70
parse_claude_chatFunction · 0.70
parse_openai_responsesFunction · 0.70
parse_gemini_chatFunction · 0.70

Tested by

no test coverage detected