Skip to content

feat: Add v1 OpenAI endpoint support and remove legacy completions API#2560

Merged
BrendanWalsh merged 13 commits into
microsoft:masterfrom
ranadeepsingh:rana/support_v1_openai_api
May 20, 2026
Merged

feat: Add v1 OpenAI endpoint support and remove legacy completions API#2560
BrendanWalsh merged 13 commits into
microsoft:masterfrom
ranadeepsingh:rana/support_v1_openai_api

Conversation

@ranadeepsingh
Copy link
Copy Markdown
Collaborator

@ranadeepsingh ranadeepsingh commented May 8, 2026

Related Issues/PRs

#xxx

What changes are proposed in this pull request?

This PR updates SynapseML OpenAI integrations to support OpenAI v1-compatible base URLs such as:

https://<resource_name>.services.ai.azure.com/openai/v1

Changes include:

  • Adds v1 base URL detection and request URL construction for OpenAI chat completions, embeddings, responses, and OpenAIPrompt.
  • For v1 endpoints, sends the deployment/model as the request body model field and omits the api-version query parameter.
  • Preserves existing Azure OpenAI endpoint behavior for non-v1 URLs, including deployment-scoped paths and api-version.
  • Emits a warning when users configure a v1 base URL together with apiVersion, since apiVersion is ignored for v1-style endpoints.
  • Removes the deprecated/retired legacy OpenAICompletion API implementation, response schema, and tests.
  • Updates current OpenAI docs/notebooks and docgen metadata to remove legacy completion usage and point users to OpenAIChatCompletion, OpenAIPrompt, and OpenAIResponses.

How is this patch tested?

  • I have written tests (not required for typo or doc fix) and confirmed the proposed feature/bug-fix/change works.

Tested with the synapseml conda environment:

  • conda run -n synapseml black --check --extend-exclude 'docs/' .
  • conda run -n synapseml sbt "cognitive / Test / compile"
  • conda run -n synapseml sbt "cognitive / Test / testOnly com.microsoft.azure.synapse.ml.services.openai.OpenAIV1EndpointSuite"
  • conda run -n synapseml sbt scalastyle test:scalastyle
  • git diff --check

Note: sbt scalafmtCheckAll was attempted but this build does not define that sbt task.

Does this PR change any dependencies?

  • No. You can skip this section.
  • Yes. Make sure the dependencies are resolved correctly, and list changes here.

Does this PR add a new feature? If so, have you added samples on website?

  • No. You can skip this section.
  • Yes. Make sure you have added samples following below steps.

This adds support for OpenAI v1-compatible base URLs. Current OpenAI notebooks/docs were updated to remove retired OpenAICompletion examples and describe supported chat, responses, and embedding APIs.

Copilot AI review requested due to automatic review settings May 8, 2026 19:46
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Hey @ranadeepsingh 👋!
Thank you so much for contributing to our repository 🙌.
Someone from SynapseML Team will be reviewing this pull request soon.

We use semantic commit messages to streamline the release process.
Before your pull request can be merged, you should make sure your first commit and PR title start with a semantic prefix.
This helps us to create release messages and credit you for your hard work!

Examples of commit messages with semantic prefixes:

  • fix: Fix LightGBM crashes with empty partitions
  • feat: Make HTTP on Spark back-offs configurable
  • docs: Update Spark Serving usage
  • build: Add codecov support
  • perf: improve LightGBM memory usage
  • refactor: make python code generation rely on classes
  • style: Remove nulls from CNTKModel
  • test: Add test coverage for CNTKModel

To test your commit locally, please follow our guild on building from source.
Check out the developer guide for additional guidance on testing your change.

@ranadeepsingh
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

❌ Patch coverage is 98.36066% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.78%. Comparing base (71e8e6d) to head (97ac819).

Files with missing lines Patch % Lines
...soft/azure/synapse/ml/services/openai/OpenAI.scala 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2560      +/-   ##
==========================================
+ Coverage   84.69%   84.78%   +0.08%     
==========================================
  Files         335      334       -1     
  Lines       17753    17756       +3     
  Branches     1615     1634      +19     
==========================================
+ Hits        15036    15054      +18     
+ Misses       2717     2702      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ranadeepsingh
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ranadeepsingh
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ranadeepsingh
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ranadeepsingh
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ranadeepsingh
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ranadeepsingh
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ranadeepsingh ranadeepsingh requested a review from Copilot May 19, 2026 10:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 16/16 changed files
  • Comments generated: 0 new

@ranadeepsingh
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ranadeepsingh
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Collaborator

@BrendanWalsh BrendanWalsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from my review.

@BrendanWalsh BrendanWalsh changed the title feat: Add v1 OpenAI Endpoint support and remove legacy completions API feat: Add v1 OpenAI endpoint support and remove legacy completions API May 20, 2026
@BrendanWalsh BrendanWalsh merged commit 30cda27 into microsoft:master May 20, 2026
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants