mirror of
https://github.com/whit3rabbit/anyllm-proxy.git
synced 2026-09-22 00:00:50 +00:00
Introduce `anyllm_client` crate containing HTTP client construction, SSRF-safe DNS resolver, retry/backoff logic, rate limit header parsing, and SSE frame parsing. These were previously inlined in the proxy crate. Rename crates from `anthropic_openai_proxy`/`anthropic_openai_translate` to `anyllm_proxy`/`anyllm_translate` throughout. proxy/backend: now re-exports retry, rate limit, and SSE symbols from the client crate; `send_with_retry` and `build_http_client` are thin adapters bridging BackendAuth/TlsConfig to the client crate's types. streaming: remove duplicate `find_double_newline` and `MAX_SSE_BUFFER_SIZE` definitions; import from `crate::backend` instead. Fix missing `pub mod` declarations in translator and proxy that were accidentally replaced by doc comments (streaming, usage_map, server, redact). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
10 lines
352 B
Rust
10 lines
352 B
Rust
#[test]
|
|
fn malformed_openai_response_fails_deserialization() {
|
|
let json = include_str!("../../../fixtures/openai/chat_completion_malformed.json");
|
|
let result = serde_json::from_str::<anyllm_translate::openai::ChatCompletionResponse>(json);
|
|
assert!(
|
|
result.is_err(),
|
|
"malformed response should fail deserialization"
|
|
);
|
|
}
|