Skip to content

[Bug] ReActAgent.stopAction() does not properly handle LLM output schema issue #274

@Ljj09082

Description

@Ljj09082

Search before asking

  • I searched in the issues and found nothing similar.

Description

ReActAgent.stopAction()output = mapper.readValue(String.valueOf(output), (Class<?>) outputSchema);

Caused by: java.lang.RuntimeException: org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonParseException: Unexpected character ('' (code 96)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"json { "id": "B0092UF54A", "score": 5, "reasons": [] } "; line: 1, column: 2]parse error```json
{
"id": "B0092UF54A",
"score": 5,
"reasons": []
}

	at org.apache.flink.agents.api.agents.ReActAgent.stopAction(ReActAgent.java:193)
	... 24 more`

### How to reproduce

run ReActAgentExample; custom model deepseek-chat

### Version and environment

main
java
macOS
local Test
flink-1.20.3

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    affectVersion/0.1.0The bug affects the 0.1.0 version. The features are not needed.bug[Issue Type] Something isn't working as expected.fixVersion/0.2.0The feature or bug should be implemented/fixed in the 0.2.0 version.priority/majorDefault priority of the PR or issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions