Files
semantic-kernel/python/tests
Evan Mattson ec89fe4a5e Python: Exclude certain fields from KernelFunction model dump (#11081)
### Motivation and Context

When trying to do a model dump for `KernelFunction` models, they are
failing with a message related to:

```
pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'type'>
```

There are some class-level attributes that cannot be properly
serialized.

<!-- 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

Exclude dumping certain model attributes from the model dump, which
allows the main KernelFunction metadata and its underlying parameters to
be serialized.
- Closes #11078 
- Adds unit tests to ensure we have coverage and can dump Pydantic
models.

<!-- 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 😄
2025-03-20 02:16:30 +00:00
..
2024-11-08 00:12:07 +00:00
2023-04-13 16:12:36 -07:00