Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.Net: Fixed JSON schema name in Structured Outputs for generic types (m…
…icrosoft#9490) ### Motivation and Context <!-- 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. --> Resolves: microsoft#9416 When C# type is passed as a response format to OpenAI chat completion service, we use the type name as [JSON schema name](https://platform.openai.com/docs/api-reference/chat/create#chat-create-response_format). When the type is generic, its name will contain characters that are not allowed in JSON schema name according to OpenAI API. This PR fixes the issue by replacing invalid characters with empty string. ### 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 😄
- Loading branch information