Skip to content

rag_flow在构建计划时json字符串解析错误 #1217

@Dincin

Description

@Dincin

Bug Description

Image

产生原因分析:

  • 使用的qwen模型,导致返回参数不是只有json部分

Bug solved method

#1216 (comment)

在接收到args = tool_call.function.arguments 对args做一个简单截取

# Intercepting a valid JSON string
start = args.find("{")
end = args.rfind("}") + 1
if start != -1 and end != -1:
    args = args[start:end]
args = json.loads(args)

Environment information

  • System version: Windows 11
  • Python version: 3.12
  • OpenManus version or branch: main
  • Installation method (e.g., pip install -r requirements.txt or pip install -e .): pip install -r requirements.txt
  • model: "Qwen/Qwen3-8B"

Extra information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions