Skip to content
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: Adding Custom Url Endpoints and Headers #2232

Conversation

mstrehl
Copy link
Contributor

@mstrehl mstrehl commented Jun 11, 2024

Related Issues/PRs

Adding custom base url and headers to access additional OpenAI endpoint deployments

What changes are proposed in this pull request?

  • Adding trait HasCustomHeader that checks if a customHeader was assigned.
  • Adding customHeader to the addHeaders function to iterate through the Map of headers provided and assign them to the request.
  • Added customRootUrl - if provided will be used instead of the prepareUrlRoot() function

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.

Does this PR change any dependencies?

  • No. You can skip this section.
  • Yes. Make sure the dependencies are resolved correctly, and list changes here.
    • deploymentName parameter was changed to not required

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

@mhamilton723 mhamilton723 marked this pull request as ready for review June 11, 2024 18:50
@mhamilton723 mhamilton723 self-requested a review as a code owner June 11, 2024 18:50
@mhamilton723
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mhamilton723
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@mhamilton723 mhamilton723 left a comment

Choose a reason for hiding this comment

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

Put a few changes in for you other than that if everything passes after should be good to go

@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 72.72727% with 6 lines in your changes missing coverage. Please review.

Project coverage is 84.37%. Comparing base (440f18e) to head (321e8bc).

Files Patch % Lines
...ure/synapse/ml/services/CognitiveServiceBase.scala 71.42% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2232      +/-   ##
==========================================
- Coverage   84.43%   84.37%   -0.07%     
==========================================
  Files         327      327              
  Lines       16715    16731      +16     
  Branches     1495     1508      +13     
==========================================
+ Hits        14114    14116       +2     
- Misses       2601     2615      +14     

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

mstrehl and others added 2 commits June 12, 2024 10:14
…es/openai/OpenAIChatCompletionSuite.scala


set 'Custom Endpoint' test to be ignored

Co-authored-by: Mark Hamilton <mhamilton723@gmail.com>
…es/CognitiveServiceBase.scala


removed scalastyle and fixed syntax error

Co-authored-by: Mark Hamilton <mhamilton723@gmail.com>
@mstrehl mstrehl changed the title Adding Custom Url Endpoints and Headers feat: Adding Custom Url Endpoints and Headers Jun 12, 2024
@mstrehl
Copy link
Contributor Author

mstrehl commented Jun 12, 2024

/azp run

Copy link

Commenter does not have sufficient privileges for PR 2232 in repo microsoft/SynapseML

@mhamilton723
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mhamilton723
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mhamilton723 mhamilton723 merged commit c94d84a into microsoft:master Jun 27, 2024
59 of 68 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.

None yet

3 participants