Conversation
2 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #421
问题说明
Antigravity 现在会直接返回真实可用的 Claude 模型 ID,例如:
但 gcli2api 在请求规范化阶段仍会根据
opus/sonnet关键词,将 Claude 模型强制映射到硬编码的 4.6 模型 ID。
由于 Claude 4.6 已被 Antigravity 下线,这会导致新模型请求被错误改写。
修改内容
移除了过时的 Claude 模型名称 remapping。
经实测 Antigravity 现在已经返回真实模型 ID,因此这里可以直接保留原始 model ID,
无需再根据 opus / sonnet 等关键词把 Claude 模型强制映射到某个固定版本。
测试结果
已实际测试以下全部 6 个模型,均可正常调用:
claude-sonnet-5-5-lowclaude-sonnet-5-5-mediumclaude-sonnet-5-5-highclaude-opus-5-5-lowclaude-opus-5-5-mediumclaude-opus-5-5-high测试log
root@xx:/home/gcli2api# curl -s
-X POST
http://127.0.0.1:7861/antigravity/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer xx"
-d '{
"model": "claude-sonnet-5-5-medium",
"messages": [
{
"role": "user",
"content": "Reply with OK"
}
],
"stream": false
}'
{"id":"5f299fbd-a8ee-4116-ab53-531ee5c48a97","object":"chat.completion","created":1791xxx755,"model":"claude-sonnet-5-5-medium","choices":[{"index":0,"message":{"role":"assistant",root@xx:/home/gcli2api# curl -s \stop"}],"usage":{"prompt_tokens":14,"completion_tokens":4,"total_tokens":18}}
root@xx:/home/gcli2api# curl -s
-X POST
http://127.0.0.1:7861/antigravity/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer xx"
-d '{
"model": "claude-opus-5-5-low",
"messages": [
{
"role": "user",
"content": "Reply with OK"
}
],
"stream": false
}'
{"id":"fa289fc9-4b20-4d50-8a65-985e92deda39","object":"chat.completion","created":1791xxx832,"model":"claude-opus-5-5-low","choices":[{"index":0,"message":{"role":"assistant","controot@xx:/home/gcli2api# curl -s }],"usage":{"prompt_tokens":14,"completion_tokens":4,"total_tokens":18}}
root@xx:/home/gcli2api# curl -s
-X POST
http://127.0.0.1:7861/antigravity/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer xx"
-d '{
"model": "claude-sonnet-5-5-high",
"messages": [
{
"role": "user",
"content": "Reply with OK"
}
],
"stream": false
}'
{"id":"3e4e0a82-bcb2-4999-a246-18dbb391a2e2","object":"chat.completion","created":1791xxx862,"model":"claude-sonnet-5-5-high","choices":[{"index":0,"message":{"role":"assistant","croot@xx:/home/gcli2api# curl -s \op"}],"usage":{"prompt_tokens":14,"completion_tokens":4,"total_tokens":18}}
root@xx:/home/gcli2api# curl -s
-X POST
http://127.0.0.1:7861/antigravity/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer xx"
-d '{
"model": "claude-sonnet-5-5-medium",
"messages": [
{
"role": "user",
"content": "Reply with OK"
}
],
"stream": false
}'
{"id":"59c8bdb4-5acf-4460-92d0-11dec8def7dd","object":"chat.completion","created":1791xxx881,"model":"claude-sonnet-5-5-medium","choices":[{"index":0,"message":{"role":"assistant",root@xx:/home/gcli2api# curl -s \stop"}],"usage":{"prompt_tokens":14,"completion_tokens":4,"total_tokens":18}}
root@xx:/home/gcli2api# curl -s
-X POST
http://127.0.0.1:7861/antigravity/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer xx"
-d '{
"model": "claude-opus-5-5-high",
"messages": [
{
"role": "user",
"content": "Reply with OK"
}
],
"stream": false
}'
{"id":"5e701a1d-d08e-4a7a-8d0b-5ed372b7544b","object":"chat.completion","created":1791xxx900,"model":"claude-opus-5-5-high","choices":[{"index":0,"message":{"role":"assistant","conroot@xx:/home/gcli2api# curl -s "}],"usage":{"prompt_tokens":14,"completion_tokens":4,"total_tokens":18}}
root@xx:/home/gcli2api# curl -s
-X POST
http://127.0.0.1:7861/antigravity/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer xx"
-d '{
"model": "claude-sonnet-5-5-low",
"messages": [
{
"role": "user",
"content": "Reply with OK"
}
],
"stream": false
}'
{"id":"0d8cd0ef-5934-4c54-89b4-6d7c578e8267","object":"chat.completion","created":1791xxx918,"model":"claude-sonnet-5-5-low","choices":[{"index":0,"message":{"role":"assistant","content":"OK"},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"completion_tokens":4,"total_tokens":18}}