-
Notifications
You must be signed in to change notification settings - Fork 854
feat: Add OpenAI API Type to OpenAIDefaults #2453
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
feat: Add OpenAI API Type to OpenAIDefaults #2453
Conversation
|
Hey @levscaut 👋! We use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
To test your commit locally, please follow our guild on building from source. |
cognitive/src/main/python/synapse/ml/services/openai/OpenAIDefaults.py
Outdated
Show resolved
Hide resolved
cognitive/src/main/python/synapse/ml/services/openai/OpenAIDefaults.py
Outdated
Show resolved
Hide resolved
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPrompt.scala
Show resolved
Hide resolved
|
/azp |
Supported commands
See additional documentation. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
...tive/src/test/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIDefaultsSuite.scala
Show resolved
Hide resolved
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPrompt.scala
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2453 +/- ##
==========================================
- Coverage 84.36% 84.34% -0.02%
==========================================
Files 335 335
Lines 17711 17723 +12
Branches 1610 1616 +6
==========================================
+ Hits 14942 14949 +7
- Misses 2769 2774 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for specifying the OpenAI API type (either "responses" or "chat_completions") to OpenAIDefaults, allowing users to configure which API variant should be used globally. The change extends the existing global parameter pattern used for other OpenAI configuration options.
Key Changes:
- Added
OpenAIApiTypeKeyglobal parameter and associated getter/setter/reset methods inOpenAIDefaults - Registered the
apiTypeparameter with global params inOpenAIPrompt - Updated validation logic for column types in
OpenAIPrompt - Added comprehensive test coverage in
OpenAIDefaultsSuite
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAI.scala | Defines the OpenAIApiTypeKey global key for API type parameter |
| cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIDefaults.scala | Implements setter, getter, and reset methods for the API type default value with validation |
| cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPrompt.scala | Registers apiType parameter with GlobalParams and updates column type validation logic |
| cognitive/src/test/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIDefaultsSuite.scala | Adds test coverage for the new API type getter, setter, and reset functionality |
| cognitive/src/main/python/synapse/ml/services/openai/OpenAIDefaults.py | Adds Python wrapper methods for setting, getting, and resetting API type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Related Issues/PRs
#xxx
What changes are proposed in this pull request?
Add OpenAI API Type (Responses API and Chat Completions API) to OpenAIDefault
How is this patch tested?
Does this PR change any dependencies?
Does this PR add a new feature? If so, have you added samples on website?
website/docs/documentationfolder.Make sure you choose the correct class
estimators/transformersand namespace.DocTablepoints to correct API link.yarn run startto make sure the website renders correctly.<!--pytest-codeblocks:cont-->before each python code blocks to enable auto-tests for python samples.WebsiteSamplesTestsjob pass in the pipeline.