Skip to content

Python: planner json malformed #4622

@silarsis

Description

@silarsis

https://github.com/microsoft/semantic-kernel/blob/f9bef6375cbb07dfe18948047a56ae9ab722ff62/python/semantic_kernel/planning/action_planner/action_planner.py#L116C24-L116C24

Frequently the json from the planner is erroring for being malformed, and I believe it's because of this line - it goes from, for example:

generated_plan_raw_str = '{"plan":{\n"rationale": "the list does not contain functions to generate apologies or any form of communication",\n"function": "",\n"parameters": {\n}}}\n#END-OF-PLAN'

To

generated_plan_str = '{"plan":{\n"rationale": "the list does not contain functions to generate apologies or any form of communication",\n"function": ",\n"parameters": {\n}}}'

Note the value of "function" in the json blob is now malformed.

Not sure why this line is here, perhaps it's dealing with a common issue elsewhere? But it seems to be the culprit...

Running against openai gpt-4

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpythonPull requests for the Python Semantic Kernel

Type

No type
No fields configured for issues without a type.

Projects

Status

Sprint: Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions