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:
parent
03e6a1a6e7
commit
a7315b46df
|
|
@ -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"])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue