agentscope-ai/agentscope-java

[Bug]: OpenAI Api Structured Outputs 报错

開放

#2,548 建立於 2026年8月4日

 (3 則留言) (0 個反應) (0 位負責人)Java (693 個分叉)user submission
area/core/modelbughelp wanted

倉庫指標

星標
 (3,253 顆星)
PR 合併指標
 (平均合併 2天 8小時) (30 天內合併 58 個 PR)

描述

定义返回结构:
@Data public static class Test { String name; int age; }

调用: agent.call(msg,Test.class) 报错: {"message":"{\n "error": {\n "message": "Invalid schema for response_format 'generate_response': In context=(), 'additionalProperties' is required to be supplied and to be false.",\n "type": "invalid_request_error",\n "param": "response_format",\n "code": null\n }\n}","retcode":40000})

备注:只有 openai 的 api 有这个问题, gemini ,qwen 都没有这个问题 'additionalProperties' is required to be supplied and to be false

貢獻者指南