Type de-duplication from openai-java for azure-ai-agents and azure-ai-projects packages#48353
Open
jpalvarezl wants to merge 16 commits intomainfrom
Open
Type de-duplication from openai-java for azure-ai-agents and azure-ai-projects packages#48353jpalvarezl wants to merge 16 commits intomainfrom
openai-java for azure-ai-agents and azure-ai-projects packages#48353jpalvarezl wants to merge 16 commits intomainfrom
Conversation
dargilco
approved these changes
Mar 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors azure-ai-agents to interoperate directly with openai-java reasoning and filter model types, reducing duplicated Azure-side model classes and centralizing JSON interop via helper utilities.
Changes:
- Replaced Azure-specific
Reasoning/filter model types withcom.openai.models.*equivalents and updated serialization/deserialization paths. - Added
OpenAIJsonHelperutilities to convert openai-java model instances to/fromBinaryData. - Added/updated unit tests covering reasoning and file-search filter round-trips.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/ai/azure-ai-agents/tsp-location.yaml | Updates the pinned swagger/spec commit for generation inputs. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/OpenAIJsonHelper.java | Adds BinaryData conversion helpers for openai-java objects. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromptAgentDefinition.java | Switches reasoning to openai-java Reasoning and updates JSON handling accordingly. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchTool.java | Adds overloads to set filters using openai-java filter types. |
| sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/ReasoningDedupSerializationTests.java | New tests validating reasoning and filters behavior with openai-java types. |
| sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/PromptAgentDefinitionSerializationTests.java | Extends existing tests to cover openai-java Reasoning. |
| sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/FileSearchToolSerializationTests.java | New tests for file-search tool serialization, including filters. |
| sdk/ai/azure-ai-agents/src/main/resources/META-INF/azure-ai-agents_metadata.json | Regenerated metadata reflecting removed/updated model surface. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/* (deleted) | Removes Azure-specific Reasoning* and filter model classes in favor of openai-java. |
...ure-ai-agents/src/test/java/com/azure/ai/agents/models/FileSearchToolSerializationTests.java
Show resolved
Hide resolved
sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchTool.java
Outdated
Show resolved
Hide resolved
sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromptAgentDefinition.java
Outdated
Show resolved
Hide resolved
Contributor
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
kaylieee
approved these changes
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the Azure AI Agents SDK to support direct interoperability with openai-java models for filter and reasoning types, reducing duplication and simplifying serialization logic. The most important changes are the removal of Azure-specific filter and reasoning model classes, addition of new serialization helpers, and updates to agent and tool classes to accept openai-java types.
Removal of Azure-specific filter and reasoning model classes
ComparisonFilter,ComparisonFilterType,CompoundFilter, andCompoundFilterTypeclasses fromcom.azure.ai.agents.models, removing Azure-specific filter type definitions in favor of openai-java types. [1] [2] [3] [4]Serialization and interoperability enhancements
toBinaryDataandfromBinaryDatamethods toOpenAIJsonHelperfor converting openai-java objects to and fromBinaryData, enabling seamless serialization/deserialization between Azure and openai-java models.OpenAIJsonHelperfor serialization tasks. [1] [2]Updates to agent and tool classes for openai-java compatibility
PromptAgentDefinitionto usecom.openai.models.Reasoningdirectly for itsreasoningproperty, updating its getter, setter, serialization, and deserialization logic accordingly. [1] [2] [3] [4] [5] [6]FileSearchToolallowing filters to be set using openai-javaComparisonFilterorCompoundFiltertypes, with conversion handled byOpenAIJsonHelper.These changes streamline the SDK's support for openai-java models, making it easier to integrate and reducing code duplication.