Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: missing more advanced json schema serializer #6280

Closed
moonbox3 opened this issue May 16, 2024 · 0 comments · Fixed by #6335
Closed

Python: missing more advanced json schema serializer #6280

moonbox3 opened this issue May 16, 2024 · 0 comments · Fixed by #6335
Assignees
Labels
python Pull requests for the Python Semantic Kernel

Comments

@moonbox3
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

Python can handle some schema types, but for more advanced schemas and handling there is no KernelJsonSchema.

In dotnet's KernelParameterMetadata, there exists:

KernelParameterMetadata L103

semantic-kernel/dotnet/src/SemanticKernel.Abstractions/Functions/KernelParameterMetadata.cs at main · microsoft/semantic-kernel (github.com)

@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel triage labels May 16, 2024
@github-actions github-actions bot changed the title Python: missing more advanced json schema serializer .Net: Python: missing more advanced json schema serializer May 16, 2024
@github-actions github-actions bot changed the title .Net: Python: missing more advanced json schema serializer Python: missing more advanced json schema serializer May 16, 2024
@moonbox3 moonbox3 self-assigned this May 18, 2024
@moonbox3 moonbox3 removed .NET Issue or Pull requests regarding .NET code triage labels May 18, 2024
github-merge-queue bot pushed a commit that referenced this issue May 20, 2024
… Memory Connectors. (#6335)

### Motivation and Context

The Python code base could handle some primitive types for the schema
for tool call objects and kernel parameter metadata. However, it
couldn't properly handle the more complex JSON schemas for tool call
objects.

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

This PR introduces:
- JSON schema handling for KernelParameterMetadata and tool call
objects.
- Updates to the tool call utils method to properly recurse on the
KernelParameterMetadata's stucture.
- Adds unit tests for this code.
- Add experimental_class/experimental_functions to various parts of the
code base like Memory Connectors and OpenAPI plugin.
- Fixes #6310 
- Fixes #6280

<!-- 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 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests for the Python Semantic Kernel
Projects
Status: Sprint: Done
2 participants