Skip to content

[Bug]: 配置Claude Code模型报错 #1889

@wangzhengbo1204

Description

@wangzhengbo1204

Runtime environment

Ubuntu 22.04.2 LTS

Exception

[2025-12-26 07:33:53 +0000] [2990190] [INFO] 127.0.0.1:40094 POST /api/v1/provider/models/llm/_/test 1.1 500 177 48426 Traceback (most recent call last): File "/home/owen/.cache/uv/archive-v0/Rz93uE5q1NCgU7kKaNHep/lib/python3.12/site-packages/langbot/pkg/api/http/controller/group.py", line 152, in handler_error return await f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/owen/.cache/uv/archive-v0/Rz93uE5q1NCgU7kKaNHep/lib/python3.12/site-packages/langbot/pkg/api/http/controller/groups/provider/models.py", line 44, in _ await self.ap.llm_model_service.test_llm_model(model_uuid, json_data) File "/home/owen/.cache/uv/archive-v0/Rz93uE5q1NCgU7kKaNHep/lib/python3.12/site-packages/langbot/pkg/api/http/service/model.py", line 114, in test_llm_model await runtime_llm_model.requester.invoke_llm( File "/home/owen/.cache/uv/archive-v0/Rz93uE5q1NCgU7kKaNHep/lib/python3.12/site-packages/langbot/pkg/provider/modelmgr/requesters/anthropicmsgs.py", line 149, in invoke_llm resp = await self.client.messages.create(**args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/owen/.cache/uv/archive-v0/Rz93uE5q1NCgU7kKaNHep/lib/python3.12/site-packages/anthropic/_utils/_utils.py", line 281, in wrapper raise TypeError(msg) TypeError: Missing required arguments; Expected either ('max_tokens', 'messages' and 'model') or ('max_tokens', 'messages', 'model' and 'stream') arguments to be given [2025-12-26 07:34:05 +0000] [2990190] [INFO] 127.0.0.1:49796 POST /api/v1/provider/models/llm/_/test 1.1 500 177 45768

Image 点击“测试”按钮,会报上面的错误。

Reproduction steps

No response

Enabled plugins

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug?Bug或Bug修复相关 / maybe a bugm: ProviderLLM 模型相关 / LLMs managementpd: Need reproducingpending: 需要测试以复现的issue,若您遇到相同问题,请提供更多的有价值的信息 / Please add more info as you can for us to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions