Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Conversation

@jdubois
Copy link
Contributor

@jdubois jdubois commented Mar 5, 2024

Allow the customization of the "User-Agent" sent as a header by okhttp3.

My goal is to use it in LangChain4J OpenAI at https://github.com/langchain4j/langchain4j/tree/main/langchain4j-open-ai to have something similar to what we have in LangChain4J Azure OpenAI (see https://github.com/langchain4j/langchain4j/blob/200522f558509a67e940ae4c82284b85caaebef8/langchain4j-azure-open-ai/src/main/java/dev/langchain4j/model/azure/InternalAzureOpenAiHelper.java#L77 ).

This is important as this allows Azure OpenAI (and probably also OpenAI) to see which tool or library people are using, which is important to get support from them.

Copy link
Contributor

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

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

@jdubois thanks!

@ai-for-java ai-for-java merged commit 98cb30c into ai-for-java:main Mar 8, 2024
private DefaultOpenAiClient(Builder serviceBuilder) {
this.baseUrl = serviceBuilder.baseUrl;
this.apiVersion = serviceBuilder.apiVersion;
this.userAgent = serviceBuilder.userAgent;

Choose a reason for hiding this comment

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

new member field userAgent is not used
so it's probably not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed I messed up! But that's already merged, so I'll do another PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

4 participants