Skip to content

Commit

Permalink
sync c# logic
Browse files Browse the repository at this point in the history
  • Loading branch information
joowon-dm-snu committed Jul 26, 2023
1 parent 09de751 commit 1af1edc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/semantic_kernel/planning/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def update_context_with_outputs(self, context: SKContext) -> None:
context.variables.update(result_string)

for item in self._steps[self._next_step_index - 1]._outputs:
if item in self._state.contains_key(item):
if self._state.contains_key(item):
context.variables.set(item, self._state[item])
else:
context.variables.set(item, result_string)
Expand Down Expand Up @@ -389,6 +389,7 @@ def get_next_step_variables(
# Priority for remaining stepVariables is:
# - Function Parameters (pull from variables or state by a key value)
# - Step Parameters (pull from variables or state by a key value)
# - All other variables. These are carried over in case the function wants access to the ambient content.
function_params = step.describe()
for param in function_params._parameters:
if param.name.lower() == variables._main_key.lower():
Expand All @@ -415,6 +416,10 @@ def get_next_step_variables(
else:
step_variables.set(param_var, expanded_value)

for item in variables._variables:
if not step_variables.contains_key(item):
step_variables.set(item, variables[item])

return step_variables

def expand_from_variables(
Expand Down

0 comments on commit 1af1edc

Please sign in to comment.