()
| 37 | |
| 38 | impl Default for ProxyConfig { |
| 39 | fn default() -> Self { |
| 40 | Self { |
| 41 | endpoints: vec![ |
| 42 | // OpenAI compatible endpoint |
| 43 | EndpointConfig { |
| 44 | path: "/api/provider/openai/v1/chat/completions".to_string(), |
| 45 | target_url: "https://api.openai.com/v1/chat/completions".to_string(), |
| 46 | method: "POST".to_string(), |
| 47 | response_type: ResponseType::Stream, |
| 48 | custom_headers: HashMap::new(), |
| 49 | forward_request_headers: vec![ |
| 50 | "authorization".to_string(), |
| 51 | "content-type".to_string(), |
| 52 | "user-agent".to_string(), |
| 53 | "accept".to_string(), |
| 54 | "accept-encoding".to_string(), |
| 55 | ], |
| 56 | forward_response_headers: vec![ |
| 57 | "content-type".to_string(), |
| 58 | "cache-control".to_string(), |
| 59 | ], |
| 60 | enabled: true, |
| 61 | }, |
| 62 | // Anthropic compatible endpoint |
| 63 | EndpointConfig { |
| 64 | path: "/api/provider/anthropic/v1/messages".to_string(), |
| 65 | target_url: "https://api.anthropic.com/v1/messages".to_string(), |
| 66 | method: "POST".to_string(), |
| 67 | response_type: ResponseType::Stream, |
| 68 | custom_headers: HashMap::new(), |
| 69 | forward_request_headers: vec![ |
| 70 | "authorization".to_string(), |
| 71 | "content-type".to_string(), |
| 72 | "user-agent".to_string(), |
| 73 | "accept".to_string(), |
| 74 | "accept-encoding".to_string(), |
| 75 | "anthropic-version".to_string(), |
| 76 | ], |
| 77 | forward_response_headers: vec![ |
| 78 | "content-type".to_string(), |
| 79 | "cache-control".to_string(), |
| 80 | ], |
| 81 | enabled: true, |
| 82 | }, |
| 83 | // LLM proxy endpoint |
| 84 | EndpointConfig { |
| 85 | path: "/api/tab/llm-proxy".to_string(), |
| 86 | target_url: "https://ampcode.com/api/tab/llm-proxy".to_string(), |
| 87 | method: "POST".to_string(), |
| 88 | response_type: ResponseType::Sse, |
| 89 | custom_headers: HashMap::new(), |
| 90 | forward_request_headers: vec![ |
| 91 | "authorization".to_string(), |
| 92 | "user-agent".to_string(), |
| 93 | "x-amp-feature".to_string(), |
| 94 | "accept-language".to_string(), |
| 95 | "sec-fetch-mode".to_string(), |
| 96 | ], |
nothing calls this directly
no outgoing calls
no test coverage detected