feat: Anthropic provider/inbound + embeddings

- Anthropic outbound provider: /v1/messages, system extraction, x-api-key +
  anthropic-version; streaming translates Anthropic SSE -> unified OpenAI wire format
- Anthropic inbound adapter (POST /v1/messages): non-streaming JSON + streaming SSE
  (OpenAI -> Anthropic event translation)
- Embeddings: POST /v1/embeddings inbound + Provider::embed(); embedding models
  resolvable from the pool (registry no longer skips them)
- protocols mounted always, gated on live flags; admin meta marks them implemented

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
infosave2007
2026-06-30 16:50:22 +03:00
co-authored by Claude Opus 4.8
parent b6fdf23aa6
commit 7dbc39c6a6
9 changed files with 528 additions and 24 deletions
+3 -3
View File
@@ -271,7 +271,7 @@ async fn meta() -> ApiResult {
ok(json!({
"version": env!("CARGO_PKG_VERSION"),
"providers": ["openai", "anthropic", "ollama", "http"],
"provider_impl": { "openai": true, "ollama": true, "http": true, "anthropic": false },
"provider_impl": { "openai": true, "ollama": true, "http": true, "anthropic": true },
"cost_tiers": ["cheap", "mid", "expensive"],
"kinds": ["chat", "embedding"],
"profiles": ["cost-saver", "balanced", "quality-first"],
@@ -280,8 +280,8 @@ async fn meta() -> ApiResult {
"tiers": ["low", "medium", "high"],
"caps": ["tools", "vision"],
"protocols_impl": {
"openai_chat": true, "openai_completions": false, "openai_embeddings": false,
"openai_models": false, "anthropic_messages": false, "mcp": false, "native_passthrough": false
"openai_chat": true, "openai_completions": false, "openai_embeddings": true,
"openai_models": false, "anthropic_messages": true, "mcp": false, "native_passthrough": false
},
"languages": ["en", "ru", "de", "fr", "es", "zh", "tr"],
}))