mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context #505 ### Description for semantics skills, original code provide `import_semantic_skill_from_directory`. I hope native functions can be handled like that. ``` kernel = sk.Kernel() # import skills skills_directory = os.path.join( os.path.dirname(__file__), "../..", "test_native_skills" ) # path to skills directory skill_config_dict = kernel.import_native_skill_from_directory( skills_directory, "FileIOSkill" ) ``` <img width="1277" alt="image" src="https://user-images.githubusercontent.com/69464062/232785972-6a882609-b3cd-41d5-8ab7-0bb2fc0a1475.png"> Co-authored-by: Abby Harrison <[email protected]>
27 lines
570 B
Python
27 lines
570 B
Python
from semantic_kernel.skill_definition import sk_function
|
|
|
|
|
|
class TestNativeEchoBotSkill:
|
|
"""
|
|
Description: Test Native Skill for testing purposes
|
|
"""
|
|
|
|
@sk_function(
|
|
description="Echo for input text",
|
|
name="echoAsync",
|
|
input_description="The text to echo",
|
|
)
|
|
async def echo(self, text: str) -> str:
|
|
"""
|
|
Echo for input text
|
|
|
|
Example:
|
|
"hello world" => "hello world"
|
|
Args:
|
|
text -- The text to echo
|
|
|
|
Returns:
|
|
input text
|
|
"""
|
|
return text
|