Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Modify Plan class to update context variables with input (micro…
…soft#685) ### Motivation and Context Fix issue with invoking plan with both string input and existing context. ### Description This pull request refactors the Plan class to update the context variables with the input string when invoking a plan. This change allows the plan to use the input as part of the context for executing the plan steps. The pull request also adds a unit test to verify that the plan can execute with a given context and input. Details: - In Plan.cs, change the InvokeAsync method to create a new SKContext with empty variables if the context parameter is null, and then update the context variables with the input string. - In PlanTests.cs, add a new test method called CanExecutePlanWithContextAsync that creates a mock context with some variables, memory, skills, and log, and then invokes a plan with the context and an input string. The test asserts that the plan returns the input string as the result, and that the context variables are updated with the input. The test also invokes the plan again with a different input string and the same context, and asserts that the result and the context variables are updated accordingly.
- Loading branch information