Python: Renames SK prefix to Kernel (#4716)

### Motivation and Context
The .NET SDK uses the `Kernel` prefix instead of `SK` for the context,
function, model, etc. classes. This PR aligns the Python package with
that policy.

Fixes #4561 
### Contribution Checklist

- [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 😄
This commit is contained in:
Julio Carlos Menendez
2024-01-24 15:51:56 +00:00
committed by GitHub
parent a5ce301656
commit 08710373a4
93 changed files with 786 additions and 759 deletions
+7 -7
View File
@@ -170,7 +170,7 @@ from this field is sufficient to have these types of classes as valid Pydantic f
any class using them as attributes to be serialized.
```python
from semantic_kernel.sk_pydantic import PydanticField
from semantic_kernel.kernel_pydantic import PydanticField
class B(PydanticField): ... # correct, B is still an ABC because PydanticField subclasses ABC
class B(PydanticField, ABC): ... # Also correct
@@ -223,13 +223,13 @@ class A:
self.d = d
```
You would convert this to a Pydantic class by subclassing from the `SKBaseModel` class.
You would convert this to a Pydantic class by subclassing from the `KernelBaseModel` class.
```python
from pydantic import Field
from semantic_kernel.sk_pydantic import SKBaseModel
from semantic_kernel.kernel_pydantic import KernelBaseModel
class A(SKBaseModel):
class A(KernelBaseModel):
# The notation for the fields is similar to dataclasses.
a: int
b: float
@@ -255,14 +255,14 @@ class A:
self.c = c
```
You can uses the `SKGenericModel` to convert these to pydantic serializable classes.
You can use the `KernelBaseModel` to convert these to pydantic serializable classes.
```python
from typing import Generic
from semantic_kernel.sk_pydantic import SKGenericModel
from semantic_kernel.kernel_pydantic import KernelBaseModel
class A(SKGenericModel, Generic[T1, T2]):
class A(KernelBaseModel, Generic[T1, T2]):
# T1 and T2 must be specified in the Generic argument otherwise, pydantic will
# NOT be able to serialize this class
a: int