mirror of
https://github.com/Alishahryar1/free-claude-code.git
synced 2026-06-01 22:09:04 +02:00
feat(providers): native Anthropic Messages for Kimi, Fireworks, Z.ai
Route these providers through POST /messages with vendor headers and bases (including Kimi model list on OpenAI /v1/models). Remove Z.ai from OpenAI-chat server-tool rejection; extend tests and README.
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ TokenCounter = Callable[[list[Any], str | list[Any] | None, list[Any] | None], i
|
||||
ProviderGetter = Callable[[str], BaseProvider]
|
||||
|
||||
# Providers that use ``/chat/completions`` + Anthropic-to-OpenAI conversion (not native Messages).
|
||||
_OPENAI_CHAT_UPSTREAM_IDS = frozenset({"nvidia_nim", "opencode", "opencode_go", "zai"})
|
||||
_OPENAI_CHAT_UPSTREAM_IDS = frozenset({"nvidia_nim", "opencode", "opencode_go"})
|
||||
|
||||
|
||||
def anthropic_sse_streaming_response(
|
||||
|
||||
@@ -79,7 +79,7 @@ def openai_chat_upstream_server_tool_error(
|
||||
)
|
||||
if not forced and has_listed_anthropic_server_tools(request):
|
||||
return (
|
||||
"OpenAI Chat upstreams (NVIDIA NIM) cannot use listed Anthropic server tools "
|
||||
"OpenAI Chat upstreams cannot use listed Anthropic server tools "
|
||||
"(web_search / web_fetch) without the local web server tool handler. Use a native "
|
||||
"Anthropic transport, set ENABLE_WEB_SERVER_TOOLS=true and force the tool with "
|
||||
"tool_choice, or remove these tools from the request."
|
||||
|
||||
Reference in New Issue
Block a user