Update samples to use agent endpoint - #50357
Conversation
Add union-safe voice APIs, preserve realtime function schemas, refresh Agent Insights generation, complete release notes, and fix spelling validation.
|
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. |
| .setVersionSelector(new VersionSelector().setVersionSelectionRules(Collections.singletonList( | ||
| new FixedRatioVersionSelectionRule(100).setAgentVersion(versionDetails.getVersion())))) | ||
| .setProtocolConfiguration(new ProtocolConfiguration().setResponses(new ResponsesProtocolConfiguration())); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
We may want to keep this line to show that we have a helper method that allows you to extract the Azure-specific fields.
| // To extract Azure-specific response details: | ||
| AzureCreateResponseDetails azureResults = ResponsesClient.getAzureFields(response); |
There was a problem hiding this comment.
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.
| AgentReference agentReference = new AgentReference(agent.getName()) | ||
| .setVersion(agent.getVersion()); | ||
| SampleUtils.pinAgentVersion(agentsClient, agent); | ||
| OpenAIClient openAIClient = builder.buildAgentScopedOpenAIClient(agent.getName()); |
There was a problem hiding this comment.
The agent.getVersion() gets lost changing to using the OpenAI client.
| try { | ||
| // Create a response | ||
| AgentReference agentReference = new AgentReference(agent.getName()) | ||
| .setVersion(agent.getVersion()); |
There was a problem hiding this comment.
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.
No description provided.