Skip to content

Update samples to use agent endpoint - #50357

Open
Kaylie (kaylieee) wants to merge 52 commits into
mainfrom
kaylieee/agent-endpoint-samples
Open

Update samples to use agent endpoint#50357
Kaylie (kaylieee) wants to merge 52 commits into
mainfrom
kaylieee/agent-endpoint-samples

Conversation

@kaylieee

Copy link
Copy Markdown
Member

No description provided.

Add union-safe voice APIs, preserve realtime function schemas, refresh Agent Insights generation, complete release notes, and fix spelling validation.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
36 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Comment on lines +78 to +80
.setVersionSelector(new VersionSelector().setVersionSelectionRules(Collections.singletonList(
new FixedRatioVersionSelectionRule(100).setAgentVersion(versionDetails.getVersion()))))
.setProtocolConfiguration(new ProtocolConfiguration().setResponses(new ResponsesProtocolConfiguration()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could add a setVersionSelectionRule method to VersionSelector which wraps a single VersionSelectionRule in a singleton list. like you do here. It's a small convenience, but I am not sure if people will more commonly set multiple rules or just a single rule.

new AzureCreateResponseOptions().setAgentReference(agentReference),
ResponseCreateParams.builder().conversation(conversation.id()));
// To extract Azure-specific response details:
AzureCreateResponseDetails azureResults = ResponsesClient.getAzureFields(response);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We may want to keep this line to show that we have a helper method that allows you to extract the Azure-specific fields.

Comment on lines -279 to -280
// To extract Azure-specific response details:
AzureCreateResponseDetails azureResults = ResponsesClient.getAzureFields(response);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess this is because of the above change to ReadmeSamples but yeah, we may want to keep this to give visibility to the helper in the readme.

Comment on lines -71 to +70
AgentReference agentReference = new AgentReference(agent.getName())
.setVersion(agent.getVersion());
SampleUtils.pinAgentVersion(agentsClient, agent);
OpenAIClient openAIClient = builder.buildAgentScopedOpenAIClient(agent.getName());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The agent.getVersion() gets lost changing to using the OpenAI client.

try {
// Create a response
AgentReference agentReference = new AgentReference(agent.getName())
.setVersion(agent.getVersion());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems like agent.getVersion() is no longer passed in any of the samples now. Not sure if that was necessary to begin with when using an agent scoped OpenAI client.

Base automatically changed from jpalvarezl/release/2_5_0 to main September 9, 2026 23:50
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.

2 participants