Skip to content

feat: Add top_p and seed params to OpenAIDefaults - #2410

Merged
Mark Hamilton (mhamilton723) merged 16 commits into
microsoft:masterfrom
ranadeepsingh:rana/add_top-p_seed_params
Aug 7, 2025
Merged

feat: Add top_p and seed params to OpenAIDefaults#2410
Mark Hamilton (mhamilton723) merged 16 commits into
microsoft:masterfrom
ranadeepsingh:rana/add_top-p_seed_params

Conversation

@ranadeepsingh

@ranadeepsingh Rana Singh (ranadeepsingh) commented Aug 5, 2025

Copy link
Copy Markdown
Collaborator

Related Issues/PRs

Close #2407
Close #2408

What changes are proposed in this pull request?

Add pass through new parameters that can be configured for openai chat.compleitions calls

  • top_p
  • seed

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.
    Added tests to check for updates

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.
    Added exmaples in Jupyter Notebook here
  1. Find the corresponding markdown file for your new feature in website/docs/documentation folder.
    Make sure you choose the correct class estimators/transformers and namespace.
  2. Follow the pattern in markdown file and add another section for your new API, including pyspark, scala (and .NET potentially) samples.
  3. Make sure the DocTable points to correct API link.
  4. Navigate to website folder, and run yarn run start to make sure the website renders correctly.
  5. Don't forget to add <!--pytest-codeblocks:cont--> before each python code blocks to enable auto-tests for python samples.
  6. Make sure the WebsiteSamplesTests job pass in the pipeline.

Introduces support for setting, getting, and resetting 'seed' and 'top_p' parameters in OpenAIDefaults for both Python and Scala. Adds input validation for 'temperature' (0.0-2.0) and 'top_p' (0.0-1.0) in both languages. Updates tests to cover new parameters and validation logic.
@ranadeepsingh Rana Singh (ranadeepsingh) changed the title Add top_p and seed params to OpenAIDefaults feat: Add top_p and seed params to OpenAIDefaults Aug 5, 2025
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Aug 5, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.45%. Comparing base (a394061) to head (ebc94b2).
⚠️ Report is 78 commits behind head on master.

Files with missing lines Patch % Lines
...soft/azure/synapse/ml/services/openai/OpenAI.scala 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2410      +/-   ##
==========================================
- Coverage   84.48%   84.45%   -0.04%     
==========================================
  Files         332      332              
  Lines       17251    17271      +20     
  Branches     1552     1555       +3     
==========================================
+ Hits        14575    14586      +11     
- Misses       2676     2685       +9     

☔ 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.

Comment thread docs/Explore Algorithms/OpenAI/OpenAI.ipynb

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Amazing, minor Qs

@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

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

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

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mhamilton723
Mark Hamilton (mhamilton723) merged commit 7c2f22a into microsoft:master Aug 7, 2025
67 of 70 checks passed
@ranadeepsingh
Rana Singh (ranadeepsingh) deleted the rana/add_top-p_seed_params branch August 8, 2025 20:39
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.

Add configurable seed parameter to OpenAIDefaults Add configurable top_p parameter to OpenAIDefaults

3 participants