-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Using generated Azure HttpPipeline for the openai-java SDK
#47659
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request propagates changes from PR #47416 to integrate Azure's HttpPipeline with the OpenAI Java SDK for the azure-ai-projects module. The implementation adapts the Azure HTTP pipeline to work with OpenAI SDK clients, enabling the use of Azure's built-in retry policies, authentication, telemetry, and logging.
Key Changes:
- Introduced HttpClientHelper to bridge Azure HttpPipeline with OpenAI's HttpClient interface
- Added AzureHttpResponseAdapter to translate Azure responses to OpenAI format
- Modified EvaluationsClient builders to use the Azure HttpPipeline instead of OpenAI's native HTTP handling
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| HttpClientHelper.java (azure-ai-projects) | New adapter class that wraps Azure HttpPipeline to implement OpenAI HttpClient interface, handling request/response translation and exception mapping |
| AzureHttpResponseAdapter.java (azure-ai-projects) | New adapter that exposes Azure HttpResponse as OpenAI HttpResponse for seamless integration |
| AIProjectClientBuilder.java | Updated to inject HttpClientHelper into Evaluations clients, removed redundant user-agent and timeout configuration (now handled by pipeline), and set maxRetries to 0 to prevent duplicate retry logic |
| HttpClientHelper.java (azure-ai-agents) | Enhanced exception mapping to properly handle AzureException by unwrapping the cause |
Related issue: #47540
azure-ai-projectsfolder