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

Function target_path

tests/format_runtime.rs:1432–1450  ·  view source on GitHub ↗
(format: RequestFormat, req: &InternalRequest)

Source from the content-addressed store, hash-verified

1430}
1431
1432fn target_path(format: RequestFormat, req: &InternalRequest) -> String {
1433 match format {
1434 RequestFormat::OpenAiChat => "/v1/chat/completions".to_string(),
1435 RequestFormat::ClaudeChat => "/v1/messages".to_string(),
1436 RequestFormat::OpenAiResponses => "/v1/responses".to_string(),
1437 RequestFormat::GeminiChat => {
1438 let model = if req.model.is_empty() {
1439 "gemini-2.5-flash"
1440 } else {
1441 req.model.as_str()
1442 };
1443 if req.stream {
1444 format!("/v1beta/models/{model}:streamGenerateContent")
1445 } else {
1446 format!("/v1beta/models/{model}:generateContent")
1447 }
1448 }
1449 }
1450}
1451
1452fn rewrite_path(original_path: &str, transformed_path: String) -> String {
1453 for pattern in ["/v1/chat/completions", "/v1/messages", "/v1/responses"] {

Callers 1

process_requestFunction · 0.70

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected