Files
semantic-kernel/python/semantic_kernel
Abby HarrisonandShawn Callegari 7b3dc2c47f Python: Filter only json content from basic planner execution input (#1496)
### Motivation and Context
Closes #1469 

There are scenarios where the basic_planner prompt results in a valid
plan surrounded by additional text. This renders the plan unable to be
json deserialized. This PR addresses this scenario. Note that it does
NOT address malformed json.

### Description
- added a regex in basic_planner.execute_plan_async that grabs only json
blocks. See screenshot below of it ignoring additional, non-json text.
- Added dependency on `regex` pip package (`re` package does not support
regex recursion)

Co-authored-by: Shawn Callegari <[email protected]>
2023-06-14 17:28:25 -07:00
..