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

openai[patch]: Update default headers azure & Add Token Provider Check #5379

Merged
merged 8 commits into from
May 15, 2024

Conversation

sarangan12
Copy link
Contributor

@sarangan12 sarangan12 commented May 15, 2024

This PR is to:

  1. Add a default user agent to header requests for Azure requests in the @langchain/openai library.
  2. We need to check for instance name & deployment name when using the token provider

@achandmsft @deyaaeldeen @xirzec FYI.....

Copy link

vercel bot commented May 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2024 9:40pm
langchainjs-docs ✅ Ready (Inspect) Visit Preview May 15, 2024 9:40pm

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. auto:improvement Medium size change to existing code to handle new use-cases labels May 15, 2024
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels May 15, 2024
@sarangan12 sarangan12 changed the title Update default headers azure Update default headers azure & Add Token Provider Check May 15, 2024
@sinedied
Copy link
Contributor

@jacoblee93 could you help us get this one merged? 🙏

It fixes a blocking issue when the token provider, and sets the user agent in a similar way as we did in the previous Azure Open integration. Thank you!

sarangan12 and others added 3 commits May 15, 2024 11:54
Co-authored-by: Yohan Lasorsa <noda@free.fr>
Co-authored-by: Yohan Lasorsa <noda@free.fr>
Co-authored-by: Yohan Lasorsa <noda@free.fr>
@jacoblee93
Copy link
Collaborator

Sure, can cherry pick this one too if urgent.

@jacoblee93 jacoblee93 added the lgtm PRs that are ready to be merged as-is label May 15, 2024
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels May 15, 2024
@jacoblee93 jacoblee93 merged commit a287cae into langchain-ai:main May 15, 2024
17 checks passed
@jacoblee93 jacoblee93 changed the title Update default headers azure & Add Token Provider Check openai[patch]: Update default headers azure & Add Token Provider Check May 15, 2024
jacoblee93 pushed a commit that referenced this pull request May 15, 2024
* Update Default Headers for Azure OpenAI Requests

* nit

* Update user agent string

* Add Token Provider check

* Update libs/langchain-openai/src/azure/llms.ts

Co-authored-by: Yohan Lasorsa <noda@free.fr>

* Update libs/langchain-openai/src/azure/embeddings.ts

Co-authored-by: Yohan Lasorsa <noda@free.fr>

* Update libs/langchain-openai/src/azure/chat_models.ts

Co-authored-by: Yohan Lasorsa <noda@free.fr>

* Format the code

---------

Co-authored-by: Yohan Lasorsa <noda@free.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:improvement Medium size change to existing code to handle new use-cases lgtm PRs that are ready to be merged as-is size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants