Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an OpenAPI-tool integration sample for Azure AI Agents and a helper for loading OpenAPI JSON specs from disk.
Changes:
- Added a sample OpenAPI spec (httpbin) under sample resources.
- Added
OpenApiSample.javademonstrating creating an agent with an OpenAPI tool and invoking it via conversation/response APIs. - Added
OpenApiFunctionDefinition.readSpecFromFile(Path)to load spec JSON into theMap<String, BinaryData>shape expected by the tool definition.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| sdk/ai/azure-ai-agents/src/samples/resources/assets/httpbin_openapi.json | Adds a minimal httpbin OpenAPI spec used by the sample. |
| sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/OpenApiSample.java | New runnable sample demonstrating OpenAPI tool integration end-to-end. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiFunctionDefinition.java | Adds a convenience method to load OpenAPI specs from JSON files. |
sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiFunctionDefinition.java
Outdated
Show resolved
Hide resolved
sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiFunctionDefinition.java
Outdated
Show resolved
Hide resolved
sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/OpenApiSample.java
Outdated
Show resolved
Hide resolved
sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/OpenApiSample.java
Show resolved
Hide resolved
sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/OpenApiSample.java
Show resolved
Hide resolved
Contributor
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
e7567cf to
b8fb5b5
Compare
kaylieee
approved these changes
Mar 7, 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 introduces a new sample demonstrating how to integrate an OpenAPI tool with the Azure AI Agents SDK, allowing agents to call external APIs defined by OpenAPI specification files. The main changes include adding a sample Java file, providing a sample OpenAPI spec, and implementing a utility method for reading OpenAPI specs from JSON files.
OpenAPI Tool Integration Sample:
OpenApiSample.javademonstrating how to create an agent with an OpenAPI tool, load an OpenAPI spec from a file, and interact with the agent via conversation and response APIs.src/samples/resources/assets/httpbin_openapi.json.Utility Improvements:
readSpecFromFile(Path path)static method toOpenApiFunctionDefinition, enabling easy loading of OpenAPI specs from JSON files for use in agent tool definitions.OpenApiFunctionDefinition.javato support file reading and JSON parsing required by the new utility method.