Skip to content

Python: Update fake skill and planner test #2535

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

Merged
merged 4 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions python/tests/integration/fakes/writer_skill_fake.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) Microsoft. All rights reserved.

from semantic_kernel.skill_definition.sk_function_decorator import sk_function
from semantic_kernel.skill_definition import sk_function, sk_function_context_parameter

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

@sk_function(
description="Write an outline for a novel",
name="NovelOutline",
input_default_value="<!--===ENDPART===-->",
@sk_function(description="Write an outline for a novel", name="NovelOutline")
@sk_function_context_parameter(
name="endMarker",
description="The marker to use to end each chapter.",
default_value="<!--===ENDPART===-->",
)
def write_novel_outline(self, input: str) -> str:
return f"Novel outline: {input}"
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ async def test_create_plan_with_defaults_async(
assert any(
step.name == expected_function
and step.skill_name == expected_skill
and step.parameters["input"] == expected_default
# TODO: current sk_function decorator only support default values ["input"] key
# TODO: current version of fake skills used inline sk_function but actually most of them already in samples dir.
# add test helper for python to import skills from samples dir. C# already has it.
# and step.parameters["endMarker"] == expected_default
and step.parameters["endMarker"] == expected_default
for step in plan._steps
)

Expand Down