-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python: Adgudime/python/serialization/skill definition (#2329)
This is part 4 of the Serialization work for semantic kernel. Corresponding issue: #131 ### Motivation and Context While there are no user facing changes, the ReadOnlySkillCollection has been modified to remove circular dependencies that were causing issues with serialization. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### 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 😄 --------- Co-authored-by: Abby Harrison <[email protected]> Co-authored-by: Abby Harrison <[email protected]>
- Loading branch information
1 parent
e8342c6
commit 77eeff2
Showing
16 changed files
with
357 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,16 @@ | ||
# Copyright (c) Microsoft. All rights reserved. | ||
|
||
from semantic_kernel.sk_pydantic import SKBaseModel | ||
from semantic_kernel.utils.validation import validate_function_param_name | ||
|
||
|
||
class ParameterView: | ||
_name: str | ||
_description: str | ||
_default_value: str | ||
class ParameterView(SKBaseModel): | ||
name: str | ||
description: str | ||
default_value: str | ||
|
||
def __init__(self, name: str, description: str, default_value: str) -> None: | ||
validate_function_param_name(name) | ||
|
||
self._name = name | ||
self._description = description | ||
self._default_value = default_value | ||
|
||
@property | ||
def name(self) -> str: | ||
return self._name | ||
|
||
@property | ||
def description(self) -> str: | ||
return self._description | ||
|
||
@property | ||
def default_value(self) -> str: | ||
return self._default_value | ||
|
||
@name.setter | ||
def name(self, value: str) -> None: | ||
validate_function_param_name(value) | ||
self._name = value | ||
|
||
@description.setter | ||
def description(self, value: str) -> None: | ||
self._description = value | ||
|
||
@default_value.setter | ||
def default_value(self, value: str) -> None: | ||
self._default_value = value | ||
super().__init__( | ||
name=name, description=description, default_value=default_value | ||
) |
Oops, something went wrong.