### 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]>
### Motivation and Context
In the Python `BasicPlanner` one of the examples has a 'translate'
function, but doesn't quite reference it correctly in the JSON output.
### Description
The overall approach is to make the various parts of the few-shot
example in the prompt self-consistent.
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
python: fix the issue of `No module named 'semantic_kernel.planning'`.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Add __init__ file for the planning package.
### Motivation and Context
Many users and customers have expressed interest in having planning
capabilities in Python. This PR seeks to provide a basic version of the
planner so that people can learn and play around with the concepts and
can be comfortable with implementing their own versions.
A Jupyter notebook is included.
### Description
Most of the logic of the plan can be found under the `PROMPT` in
`basic_planner.py`.
There is a known limitation that this currently doesn't explicit parse
out arguments that are defined in the semantic function prompts, so when
creating the [AVAILABLE FUNCTIONS] string, it just uses the name of the
function and the description.
The execution of the plan also happens from start to finish. There is
currently no support for piecewise execution.
---------
Co-authored-by: Alex Chao <[email protected]>
Co-authored-by: Alex Chao <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Mark Karle <[email protected]>