semantic-kernel
semantic-kernel copied to clipboard
Python : Simplification for the SK decorators and core TextSkill
Motivation and Context
This PR simplifies @sk_* decorators while porting the core TextSkill
Description
This PR is a first step at adapting the python codebase to be more pythonic, it contains the following modifications :
- Merged the decorators
@sk_function_context_parameter,@sk_function_input,@sk_function_namewith@sk_function. The decorators were replaced with new kwargs onsk_function:name,input_description,input_default_value - The
namekwarg is optional, the name of the method will be used if none is provided. - Ported core skill - TextSkill
- Added some pytest unit test for SK decorators and TextSkill
- Changed how skills are imported in the kernel by using instance of the class, not relying on static method anymore for the discovery. e.g.
kernel.import_skill(TextSkill())
Contribution Checklist
- [x] The code builds clean without any errors or warnings
- [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone :smile: