Skip to content

Add structured inputs sample#48435

Merged
jpalvarezl merged 4 commits intomainfrom
kaylieee/feature/structured-inputs-sample
Mar 18, 2026
Merged

Add structured inputs sample#48435
jpalvarezl merged 4 commits intomainfrom
kaylieee/feature/structured-inputs-sample

Conversation

@kaylieee
Copy link
Member

This pull request adds a new Java sample demonstrating how to create a response with structured input parameters for an agent using the Azure AI Agents SDK. The sample shows how to define structured inputs for an agent, pass those inputs when creating a response, and handle cleanup.

New sample for structured inputs:

  • Added CreateResponseWithStructuredInput.java, which demonstrates:
    • Defining structured input fields for an agent using StructuredInputDefinition.
    • Creating an agent version with a prompt template that uses these structured inputs.
    • Creating a response by passing structured input values via the API.
    • Outputting the response and cleaning up the created agent version.

Copilot AI review requested due to automatic review settings March 17, 2026 04:16
@kaylieee kaylieee requested review from a team, jpalvarezl and trrwilson as code owners March 17, 2026 04:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Java sample to the azure-ai-agents SDK demonstrating how to define structured inputs on an agent version and pass structured input values when creating a response.

Changes:

  • Added CreateResponseWithStructuredInput.java sample showing StructuredInputDefinition usage on PromptAgentDefinition.
  • Demonstrates creating an agent version, creating a response with structured_inputs, and deleting the created agent version.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Member

@jpalvarezl jpalvarezl left a comment

Choose a reason for hiding this comment

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

This looks good to me, if we need to merge quickly, let's just do that and punt the following to a separate PR, otherwise we can address these immediately:

  • Async version of this sample
  • Feature this in the README
  • Duplicate the sync and async samples into our test package and generate new recordings.

@jpalvarezl
Copy link
Member

Addressed all the feedback here: #48440

* Sync methods added and tests

* Added async counterpart and test recordings

* README updates

* CHANGELOG updates
@github-actions
Copy link
Contributor

API Change Check

APIView identified API level changes in this PR and created the following API reviews

com.azure:azure-ai-agents

1 similar comment
@github-actions
Copy link
Contributor

API Change Check

APIView identified API level changes in this PR and created the following API reviews

com.azure:azure-ai-agents

@jpalvarezl jpalvarezl enabled auto-merge (squash) March 18, 2026 20:25
@jpalvarezl jpalvarezl merged commit 2c6e7f7 into main Mar 18, 2026
19 checks passed
@jpalvarezl jpalvarezl deleted the kaylieee/feature/structured-inputs-sample branch March 18, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants