@sk_function(
description="Extracts numbers from JSON",
name="ExtractNumbersFromJson",
)
## add "-> str" ##
def extract_numbers_from_json(self, context: SKContext) -> str:
numbers = json.loads(context["input"])
# Loop through numbers and add them to the context
for key, value in numbers.items():
if key == "number1":
# Add the first number to the input variable
context["input"] = str(value)
else:
# Add the rest of the numbers to the context
context[key] = str(value)
## add ["input"] ##
return context["input"]
Hi there, it seems that the official sample has a bug, when I execute the 10-Chaining-Functions python script, there is an error like this:![image](https://github.com/MicrosoftDocs/semantic-kernel-docs/assets/144894546/58ed77b1-e0fe-4ff4-a577-f44d738c9d22)
https://github.com/MicrosoftDocs/semantic-kernel-docs/blob/main/samples/python/10-Chaining-Functions/plugins/OrchestratorPlugin/Orchestrator.py
the correct version: