agentscope-ai / agentscope-ai/agentscope

[Bug]: `qwen3.5-35b-a3b` with a `structured_model` raise `openai.BadRequestError`

未关闭
#1,334 11 条评论 0 个 reaction 已指派 1 人 已被 @qbc2016 认领 在 GitHub 查看
主要语言
Python
星标
31.6k
派生
3.5k
平均合并
1 天 16 小时
30 天内合并 PR
103

描述

**Describe the bug**

By calling an agent in the following common pattern with a `structured_model`:

```py
agent = ReActAgent(
name="Vanilla",
sys_prompt=prompt.metadata.get(
"sys_prompt", "You're a helpful assistant named Vanilla."
),
model=OpenAIChatModel(
model_name=model,
api_key=api_key,
stream=stream,
client_kwargs={
"base_url": base_url,
"timeout": timeout,
"max_retries": max_retries,
},
generate_kwargs={
"max_tokens": max_tokens,
"temperature": temperature,
},
),
formatter=OpenAIChatFormatter(),
)

return await agent(prompt, structured_model=prompt.metadata.get("structured_model"))
```

When the `model` is set to `qwen3.5-35b-a3b`, a conflict about thinking mode and tool choice emerges:

```bash
openai.BadRequestError: Error code: 400 - {'error': {'message': '<400> ***.***.InvalidParameter: The tool_choice parameter does not support being set to required or object in thinking mode', 'type': 'invalid_request_error', 'param': '', 'code': 'invalid_parameter_error'}}
```

**To Reproduce**

Design any `structured_model` and pass it to a vanilla agent, whose model should be set to `qwen3.5-35b-a3b`.

**Expected behavior**

The `structured_model` parameter can be used with `qwen3.5-35b-a3b` without throwing exceptions.

**Error messages**

Refer to the above description.

**Environment (please complete the following information):**

- AgentScope Version: 1.0.16
- Python Version: 3.10
- OS: Ubuntu 22.04

**Additional context**

None

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。