feat: antropik cache — default anthropic-version, forward cache headers, model features, streaming usage, tests
- Auto-default anthropic-version to 2023-06-01 for prompt caching - Forward cache headers (x-cache, cf-cache-status, age, etc.) from backend - Add features: ["prompt_caching"] to /v1/models response - Extract and report actual usage tokens in streaming message_delta - Track output char count for token estimation when backend omits it - Cache-aware usage reporting: cache_creation_input_tokens, cache_read_input_tokens - Comprehensive tests for cache_control preservation in content blocks & system
This commit is contained in:
@@ -471,6 +471,7 @@ export default {
|
||||
object: "model",
|
||||
created: Math.floor(Date.now() / 1000),
|
||||
owned_by: "proxy",
|
||||
features: ["prompt_caching"],
|
||||
}));
|
||||
return new Response(
|
||||
JSON.stringify({ object: "list", data: models }),
|
||||
|
||||
Reference in New Issue
Block a user