Repository navigation
Replies: 2 comments
|
源码里很可疑的位置是 Responses API 解析。 自定义 adapter 的协议可以在 profile / connection 上配置: 建议先确认这次“测试当前模型”实际走的是 Responses 还是 Chat Completions。如果 |
|
I checked the DeepTutor Responses parser, and there is a concrete failure path worth isolating here. The existing reply correctly points toward an API-format mismatch, but I think we can make the diagnosis more precise and provide a small defensive fix. 1. Why this exact exception can occurIn return dump() if callable(dump) else vars(value)
If a gateway returns a primitive, a list, or an SDK object without a This is a plausible match for your exception, although a traceback is needed to identify the actual failing call. 2. First isolate Chat Completions vs ResponsesYour configured endpoint is Please confirm which protocol the gateway supports. If it is a Chat Completions-compatible endpoint rather than a Responses-compatible endpoint, explicitly set the custom adapter's To test the gateway independently, use its documented API base path, for example: curl -sS "$BASE_URL/chat/completions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k3",
"messages": [
{"role": "user", "content": "Reply with OK"}
],
"stream": false
}'Here A successful response should contain a Avoid publishing the real API key or full request headers. 3. Suggested defensive improvementThe current def _dump_model(value):
if isinstance(value, dict):
return value
dump = getattr(value, "model_dump", None)
if callable(dump):
result = dump()
if isinstance(result, dict):
return result
raise TypeError(
f"model_dump returned {type(result).__name__}, expected dict"
)
attributes = getattr(value, "__dict__", None)
if isinstance(attributes, dict):
return attributes
raise TypeError(
f"Unsupported Responses object: {type(value).__name__}"
)The top-level This will not magically make an incompatible gateway compatible. It simply replaces an opaque 4. Regression testsI would add tests for:
The important requirement is that unsupported shapes fail clearly, rather than causing a misleading exception deep inside parsing. What would confirm the root cause?Please share the sanitized Python traceback, especially the failing file and line number, along with the selected If switching to If the gateway really supports Responses and the traceback points to I haven't tested your specific gateway, so these are targeted diagnostic and code-hardening steps rather than a confirmed production fix. |
Uh oh!
There was an error while loading. Please reload this page.
自定义adapter,配置提供方、语言模型后,测试当前模型报:
[info] Preparing configuration snapshot.
[config] Using active profile.
[info] Loading LLM config from the active catalog selection.
[info] Resolved model
kimi-k3with bindingcustom.[info] Request target: https://openai.szfiu.com
[info] Token options: {"max_tokens": 4096}
[failed] [custom] Error calling LLM: vars() argument must have dict attribute
All reactions