Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR migrates from the Azure SDK to the OpenAI SDK to resolve an issue where the Azure SDK automatically sets an apiVersion that is too early for JSON schema responses to work with some models. The OpenAI SDK allows for more flexible version handling by letting the inference API set the version correctly.
- Replaces Azure REST AI Inference client with OpenAI SDK client
- Updates type definitions to use more specific role types instead of generic strings
- Removes Azure-specific error handling in favor of standard try-catch blocks
Reviewed Changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/inference.ts | Core migration from Azure to OpenAI SDK with updated client initialization and API calls |
| src/helpers.ts | Removes Azure-specific error handling and updates message type definitions |
| package.json | Replaces Azure dependencies with OpenAI SDK dependency |
| tests/inference.test.ts | Updates test mocks and assertions to work with OpenAI SDK instead of Azure SDK |
| .licenses/npm/openai.dep.yml | Adds license information for the new OpenAI dependency |
Yuzuki-S
approved these changes
Aug 5, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR switches from the Azure SDK to the OpenAI SDK. Unfortunately the Azure SDK automatically sets an
apiVersionwhich is too early to make JSON schema responses work with some models. If we leave offapiVersion, the inference API will set it correctly, but the Azure SDK doesn't allow you to leave the version off entirely. Thus we're switching SDKs.