Skip to content

fix #2038 Add custom-headers to the Azure Open AI Spring Boot Starter#50

Merged
langchain4j merged 1 commit into
langchain4j:mainfrom
arey:feature/custom-headers-azure-openai
Nov 7, 2024
Merged

fix #2038 Add custom-headers to the Azure Open AI Spring Boot Starter#50
langchain4j merged 1 commit into
langchain4j:mainfrom
arey:feature/custom-headers-azure-openai

Conversation

@arey

@arey arey commented Nov 6, 2024

Copy link
Copy Markdown
Contributor

Fix issue langchain4j/langchain4j#2038

Is there any markdown documentation file to complete?
Do I need to create an integration test? If so, how?

@langchain4j langchain4j left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@arey thank you!
Could you please add thease headers for other model types as well (e.g. embedding, etc)?
I am not sure how to automate testing this. Perharps you could test it manually?

@arey
arey force-pushed the feature/custom-headers-azure-openai branch from a03eda4 to 0a2c339 Compare November 7, 2024 06:26
@arey

arey commented Nov 7, 2024

Copy link
Copy Markdown
Contributor Author

I've also added the customHeaders property to the EmbeddingModelProperties and ImageModelProperties class.
I've tested the change manually from my laptop.
In the logs of the azure client, we can see that the custom-header header has been append to the redactedHeaders as expected:

2024-11-07T08:10:25.790+01:00 INFO 97681 --- [nio-8080-exec-2] c.a.a.o.i.O.getChatCompletionsSync : {"az.sdk.message":"HTTP request","method":"POST","url":"https://xxxx.azure-api.net/openai/deployments/gpt-4o/chat/completions?api-version=2024-07-01-preview","tryCount":1,"Date":"Thu, 07 Nov 2024 11:10:25 GMT","Content-Type":"application/json","x-ms-client-request-id":"ca47656d-099f-4f9c-8137-3bd8a9905ad9","Accept":"application/json","User-Agent":"langchain4j-azure-openai","redactedHeaders":"api-key,custom-header","content-length":16516}

@langchain4j langchain4j left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@arey thanks a lot!

@langchain4j
langchain4j merged commit f06f833 into langchain4j:main Nov 7, 2024
qing-wq pushed a commit to qing-wq/langchain4j-spring that referenced this pull request Nov 20, 2024
…langchain4j#50)

Fix issue langchain4j/langchain4j#2038

Is there any markdown documentation file to complete?
Do I need to create an integration test? If so, how?
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.

2 participants