-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
bugSomething isn't workingSomething isn't workingpythonPull requests for the Python Semantic KernelPull requests for the Python Semantic Kernel
Milestone
Description
Describe the bug
Native function alwasy has input parameter in its parameter list even though __sk_function_input_description__ is not set.
The same issue #2233 was closed with a fix to check if __sk_function_input_description__ is None
However it looks like this PR https://github.com/microsoft/semantic-kernel/pull/2329/files#diff-b60910d42f8eb11013690e29847e22e021d9fa9a9c2b049d769711ef55c5b447 gives a default value "" to input description
Now it's not possible to mark input as optional
To Reproduce
Steps to reproduce the behavior:
from semantic_kernel import Kernel, SKContext
from semantic_kernel.skill_definition import sk_function, sk_function_context_parameter
class TestSkill:
@sk_function(
description="Test skill",
name="testSkill",
)
@sk_function_context_parameter(
name="testParam",
description="Test parameter",
)
def test(self, context: SKContext):
pass
k = Kernel()
skill = k.import_skill(TestSkill(), "TestSkill")
for param in skill['testSkill'].parameters:
print(f"{param.name}: {param.description}")
# Result:
# input:
# testParam: Test parameterExpected behavior
# Result:
# testParam: Test parameter
Platform
- OS: Windows
- IDE: VS Code
- Language: Python
- Source: pip 0.3.8.dev0
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpythonPull requests for the Python Semantic KernelPull requests for the Python Semantic Kernel
Type
Projects
Status
Sprint: Done
