agentscope-ai / agentscope-ai/agentscope-java

[Bug] ReActAgent create fail by local vllm

未关闭
#799 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area/core/model bug
主要语言
Java
星标
5.6k
派生
1.3k
平均合并
4 天 12 小时
30 天内合并 PR
77

描述

Use the local vllm model, as shown in the code below
--
ReActAgent agent = ReActAgent.builder()
.name("Assistant")
.sysPrompt("你是一个有帮助的 AI 助手。")
.model(OpenAIChatModel.builder()
.modelName("Qwen3-Coder-30B-A3B-Instruct")
.baseUrl("http://127.0.0.1:8080/v1")
.apiKey("123456")
.stream(false)
.build())
.build();

Msg response = agent.call(Msg.builder()
.textContent("你好")
.build()).block();
--

Run time error
Exception in thread "main" io.agentscope.core.model.ModelException: Failed to call OpenAI API: OpenAI API request failed with status 400 | {"error":{"message":"[{'type': 'missing', 'loc': ('body',), 'msg': 'Field required', 'input': None}]","type":"Bad Request","param":null,"code":400}} [model=Qwen3-Coder-30B-A3B-Instruct, provider=openai]
at io.agentscope.core.model.OpenAIChatModel.lambda$doStream0$1(OpenAIChatModel.java:164)
at reactor.core.publisher.FluxDefer.subscribe(FluxDefer.java:46)
at reactor.core.publisher.FluxSubscribeOn$SubscribeOnSubscriber.run(FluxSubscribeOn.java:194)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:842)
Suppressed: java.lang.Exception: #block terminated with an error
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:104)
at reactor.core.publisher.Mono.block(Mono.java:1779)
at openai.chat.prompt.AgentScopeApplication.main(AgentScopeApplication.java:29)
Caused by: io.agentscope.core.model.exception.BadRequestException: OpenAI API request failed with status 400 | {"error":{"message":"[{'type': 'missing', 'loc': ('body',), 'msg': 'Field required', 'input': None}]","type":"Bad Request","param":null,"code":400}}
at io.agentscope.core.model.exception.OpenAIException.create(OpenAIException.java:69)
at io.agentscope.core.model.OpenAIClient.call(OpenAIClient.java:302)
at io.agentscope.core.model.OpenAIChatModel.lambda$doStream0$1(OpenAIChatModel.java:157)
... 9 more
17:42:21.398 [HttpTransportFactory-ShutdownHook] INFO io.agentscope.core.model.transport.HttpTransportFactory -- Shutting down 1 managed HttpTransport(s)

but Using curl to call vllm is fine
How to resolve

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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