mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-28 00:04:47 +08:00
fix: solves the malformed json output and pydantic validation error produced by the 'planner' node by forcing the llm response to strictly comply with the pydantic 'Plan' model (#322)
This commit is contained in:
@@ -104,7 +104,8 @@ def planner_node(
|
|||||||
if AGENT_LLM_MAP["planner"] == "basic":
|
if AGENT_LLM_MAP["planner"] == "basic":
|
||||||
llm = get_llm_by_type(AGENT_LLM_MAP["planner"]).with_structured_output(
|
llm = get_llm_by_type(AGENT_LLM_MAP["planner"]).with_structured_output(
|
||||||
Plan,
|
Plan,
|
||||||
method="json_mode",
|
method="json_schema",
|
||||||
|
strict=True,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
llm = get_llm_by_type(AGENT_LLM_MAP["planner"])
|
llm = get_llm_by_type(AGENT_LLM_MAP["planner"])
|
||||||
|
|||||||
Reference in New Issue
Block a user