Skip to content

Commit 2dea228

Browse files
lemillermicrosoftSOE-YoungS
authored andcommitted
Python: Update fake skill and planner test (microsoft#2535)
Fix failing integration tests introduced in microsoft#2474 (May be filing follow up issue on that) - Update WriterSkillFake to include a context parameter for the end marker - Update test_sequential_planner to use the new end marker parameter in WriterSkillFake ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
1 parent fe978d8 commit 2dea228

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

python/tests/integration/fakes/writer_skill_fake.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) Microsoft. All rights reserved.
22

3-
from semantic_kernel.skill_definition.sk_function_decorator import sk_function
3+
from semantic_kernel.skill_definition import sk_function, sk_function_context_parameter
44

55
# TODO: this fake skill is temporal usage.
66
# C# supports import skill from samples dir by using test helper and python should do the same
@@ -15,10 +15,11 @@ class WriterSkillFake:
1515
def translate(self, language: str) -> str:
1616
return f"Translate: {language}"
1717

18-
@sk_function(
19-
description="Write an outline for a novel",
20-
name="NovelOutline",
21-
input_default_value="<!--===ENDPART===-->",
18+
@sk_function(description="Write an outline for a novel", name="NovelOutline")
19+
@sk_function_context_parameter(
20+
name="endMarker",
21+
description="The marker to use to end each chapter.",
22+
default_value="<!--===ENDPART===-->",
2223
)
2324
def write_novel_outline(self, input: str) -> str:
2425
return f"Novel outline: {input}"

python/tests/integration/planning/sequential_planner/test_sequential_planner.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,7 @@ async def test_create_plan_with_defaults_async(
123123
assert any(
124124
step.name == expected_function
125125
and step.skill_name == expected_skill
126-
and step.parameters["input"] == expected_default
127-
# TODO: current sk_function decorator only support default values ["input"] key
128-
# TODO: current version of fake skills used inline sk_function but actually most of them already in samples dir.
129-
# add test helper for python to import skills from samples dir. C# already has it.
130-
# and step.parameters["endMarker"] == expected_default
126+
and step.parameters["endMarker"] == expected_default
131127
for step in plan._steps
132128
)
133129

0 commit comments

Comments
 (0)