Skip to content

[Bug]:在结构化输出时,总是输出失败,提示报错信息为No structured output in message metadata. Key '_structured_output' not found #641

Description

@if2018

The abnormal information is:
java.util.concurrent.CompletionException: java.lang.IllegalStateException: No structured output in message metadata. Key '_structured_output' not found.
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1770) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) ~[na:na]
at java.base/java.util.concurrent.ThreadPerTaskExecutor$TaskRunner.run(ThreadPerTaskExecutor.java:314) ~[na:na]
at java.base/java.lang.VirtualThread.run(VirtualThread.java:329) ~[na:na]

The general reason is that the tool was not called, but the specific reason is still unclear

The text information returned by Ai is:There is no format here, all are the original information returned by Ai

{
  "error": "",
  "issueDate": "2020-07-10",
  "roadTrafficSn": "11231220",
  "validityPeriod": "",
  "vehicleNum": "蒙123123"
}

OR

<tool_call>
<function=generate_response>
<parameter=response>
{"error": "", "vehicleNum": "鲁H12312", "vehicleNumColor": "黄色"}


</tool_call>

The framework I use is springboot, and I have encountered similar issues with pure Java code before, mainly with structured tools

Activity

  1. added
    bug
    on Jan 23, 2026
  2. if2018 commented on Jan 23, 2026

    @if2018
    Author
    <tool_call>
    <function=generate_response>
    <parameter=response>
    {"error": "", "vehicleNum": "陕KF1111", "vehicleNumColor": "黄色"}
    </parameter>
    </function>
    </tool_call>
    

    OR

    ```json
    {"error": "", "issueDate": "2020-07-10", "roadTrafficSn": "150111220", "validityPeriod": "", "vehicleNum": "蒙C111"}
    
  3. if2018 commented on Jan 23, 2026

    @if2018
    Author

    提示词信息为:
    请识别图片中的车牌信息,具体要求如下:

                        识别车牌号码:准确提取车牌上的所有字符(包括汉字、字母和数字)
                        识别车牌颜色:准确判断车牌底色,并返回具体颜色名称(例如:蓝色、黄色、黄绿色、白色、黑色、绿色等)
                        异常情况处理:
                        如果图片存在模糊、反光、遮挡、倾斜、光线不足或车牌区域不完整等问题,导致无法准确识别,请返回对应的错误信息,说明具体原因(例如:“图片模糊,无法识别车牌”或“反光严重,车牌号码不清晰”)
                        如果图片中未检测到车牌,请返回“未检测到车牌”
    
  4. AlbumenJ commented on Jan 24, 2026

    @AlbumenJ
    Collaborator

    What is your expected structured output class?

  5. if2018 commented on Jan 26, 2026

    @if2018
    Author

    It's this
    @EqualsAndHashCode(callSuper = true)
    @DaTa
    @AllArgsConstructor
    @NoArgsConstructor
    @SuperBuilder
    public class VehicleRoadDto extends BaseExtract {
    /**
    * 车牌号
    /
    @fieldlabel(value = "车牌号", preciseFormat = true)
    private String vehicleNum;
    /
    *
    * 道路运输证编号
    /
    @fieldlabel("证件编号")
    private String roadTrafficSn;
    /
    *
    * 有效期至
    /
    @fieldlabel("有效期至")
    @ValidPeriod(toleranceDays = 5, type = ValidPeriod.PeriodCheckType.NOT_EXPIRED)
    private String validityPeriod;
    /
    *
    * 发证日期
    */
    @fieldlabel("发证日期")
    @ValidPeriod(toleranceDays = 5)
    private String issueDate;

    }

  6. AlbumenJ commented on Jan 29, 2026

    @AlbumenJ
    Collaborator

    What is the BaseExtract?

  7. if2018 commented on Jan 29, 2026

    @if2018
    Author

    /**

  8. wuaisong commented on Apr 2, 2026

    @wuaisong

    +1

  9. LearningGp commented on Apr 3, 2026

    @LearningGp
    Member

    Could you provide the log files after reproducing the issue with debug logging enabled?

  10. added
    area/core/model
    on May 28, 2026
  11. moved this from Backlog to In progress in AgentScope Javaon Jul 8, 2026
  12. moved this from In progress to Done in AgentScope Javaon Oct 10, 2026
  13. added a commit that references this issue on Oct 10, 2026
    8eb9115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/core/modelbug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions