Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve sequential plan parser with support for missing functions. #1615

Merged

Commits on Jun 23, 2023

  1. 🐛🔧 Fix plan parsing, execution, and replacement issues

    This commit fixes several issues with the plan parsing, execution,
    and replacement logic in the sequential planner and the semantic
    kernel. It adds some unit tests to cover the scenarios where the
    plan xml is not well-formed or contains other text, where the plan
    has variables with a $ in them that are not associated with an
    output, and where the plan xml contains a function from an OpenApi
    plugin. It also fixes a bug in the Plan class, where it would not
    correctly replace all occurrences of a string in the plan actions.
    lemillermicrosoft authored and shawncal committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    3088f6d View commit details
    Browse the repository at this point in the history
  2. 🐛 Fix plan parsing, error handling, and exception enum

    This commit fixes several issues related to the sequential planner. It
    improves the plan parsing and error handling by adding a new parameter
    to the ToPlanFromXml method to optionally ignore missing functions in
    the plan xml, instead of throwing an exception. It also improves the
    exception messages and codes for different scenarios, such as invalid
    plan xml, invalid goal, or unknown error. Additionally, it catches and
    rethrows planning exceptions in the CreatePlan method, and updates the
    skprompt file to include a new step for handling unavailable functions.
    Finally, it adds a missing value to the planning exception enum and
    updates the documentation accordingly.
    lemillermicrosoft authored and shawncal committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    d8ec130 View commit details
    Browse the repository at this point in the history
  3. 🐛📝 Fix plan xml parsing and allow missing functions

    This commit fixes a bug in the sequential plan parser that caused an
    exception when the plan xml was not valid. It adds a regex to extract
    the <plan> element from the input string, and handles any xml parsing
    errors gracefully.
    
    It also adds a new option to the SequentialPlannerConfig class that
    allows the planner to create a plan even if some functions are missing
    from the skills. The missing functions are treated as no-op steps in
    the plan. This option is useful for testing and debugging purposes, but
    should be used with caution in production scenarios.
    
    The commit also improves the error messages and logging for plan
    parsing and creation, by including the function and skill names in the
    exception messages and using consistent quotes for xml strings.
    lemillermicrosoft authored and shawncal committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    2891227 View commit details
    Browse the repository at this point in the history
  4. 🐛 Fix bug in sequential plan parser

    The sequential plan parser was not handling invalid function nodes
    correctly, and would throw an exception if the allowMissingFunctions
    parameter was false. This commit adds a test case for this scenario and
    fixes the bug by checking the function name before creating the step. It
    also adds a default skill name and description for invalid function
    nodes, to avoid null reference errors.
    lemillermicrosoft authored and shawncal committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    566853c View commit details
    Browse the repository at this point in the history
  5. 📝 Handle case when plan cannot be created

    This commit adds a new error code and exception message for the
    scenario when the sequential planner cannot create a plan for a given
    goal with the available functions. It also modifies the skprompt.txt
    file to return <noplan /> instead of an empty plan in this case. The
    commit also includes some minor formatting changes and a new test case
    for the plan not possible scenario.
    lemillermicrosoft authored and shawncal committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    fed348d View commit details
    Browse the repository at this point in the history
  6. 🐛 Fix missing description and steps in sequential plan parser

    This commit fixes a bug in the sequential plan parser that caused the
    description and steps properties of the plan steps to be null or empty
    when parsing a plan from XML. The bug was due to a missing assignment
    of the description property and a wrong constructor call for the plan
    steps. The commit also adds a unit test to verify the correct behavior
    of the parser.
    lemillermicrosoft authored and shawncal committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    f064a60 View commit details
    Browse the repository at this point in the history
  7. 🐛 Throw PlanningException if plan creation fails

    This commit adds a check for the ErrorOccurred property of the
    planResult object returned by the functionFlowFunction. If it is true,
    it throws a PlanningException with the appropriate error code, message,
    and inner exception. This ensures that any errors that occur during the
    plan creation process are properly propagated and handled by the caller.
    lemillermicrosoft authored and shawncal committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    0715cf3 View commit details
    Browse the repository at this point in the history