From a7ab795134240a9d3dda538e21a097d5cb48c4f2 Mon Sep 17 00:00:00 2001 From: Jose Alvarez Date: Tue, 19 May 2026 11:57:27 +0200 Subject: [PATCH 1/3] Validate new AI sample tests --- sdk/ai/azure-ai-agents/assets.json | 2 +- .../hostedagents/CodeAgentSamplesTests.java | 2 + .../HostedAgentContainerSamplesTests.java | 166 ++++++++++++++++-- .../agents/toolboxes/ToolboxSamplesTests.java | 3 - .../ai/agents/tools/FabricIQSamplesTests.java | 87 ++++++++- sdk/ai/azure-ai-projects/assets.json | 2 +- .../com/azure/ai/projects/SamplesTests.java | 42 ++--- 7 files changed, 264 insertions(+), 40 deletions(-) diff --git a/sdk/ai/azure-ai-agents/assets.json b/sdk/ai/azure-ai-agents/assets.json index b7110f21c7ff..251a4f74845e 100644 --- a/sdk/ai/azure-ai-agents/assets.json +++ b/sdk/ai/azure-ai-agents/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/ai/azure-ai-agents", - "Tag": "java/ai/azure-ai-agents_bb4574aecb" + "Tag": "java/ai/azure-ai-agents_e191748df9" } diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/CodeAgentSamplesTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/CodeAgentSamplesTests.java index 9591947c42fb..184f8c01a363 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/CodeAgentSamplesTests.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/CodeAgentSamplesTests.java @@ -15,6 +15,7 @@ import com.azure.core.http.HttpClient; import com.azure.core.test.annotation.LiveOnly; import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -30,6 +31,7 @@ import static com.azure.core.test.TestProxyTestBase.getHttpClients; +@Disabled("Direct code deployment is not enabled for the current test subscription.") public class CodeAgentSamplesTests extends ClientTestBase { private static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/HostedAgentContainerSamplesTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/HostedAgentContainerSamplesTests.java index 95f7867938aa..18b78688ee57 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/HostedAgentContainerSamplesTests.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/HostedAgentContainerSamplesTests.java @@ -3,23 +3,50 @@ package com.azure.ai.agents.hostedagents; +import com.azure.ai.agents.AgentSessionFilesClient; +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; import com.azure.ai.agents.AgentsServiceVersion; import com.azure.ai.agents.ClientTestBase; +import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.AgentEndpointConfig; +import com.azure.ai.agents.models.AgentEndpointProtocol; +import com.azure.ai.agents.models.AgentSessionResource; +import com.azure.ai.agents.models.FixedRatioVersionSelectionRule; +import com.azure.ai.agents.models.SessionDirectoryEntry; +import com.azure.ai.agents.models.SessionDirectoryListResponse; +import com.azure.ai.agents.models.UpdateAgentDetailsOptions; +import com.azure.ai.agents.models.VersionSelector; import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.test.annotation.LiveOnly; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.openai.client.OpenAIClient; +import com.openai.core.JsonValue; +import com.openai.models.responses.ResponseCreateParams; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.stream.Stream; import static com.azure.core.test.TestProxyTestBase.getHttpClients; +@Disabled("Hosted agent version provisioning failed with the current FOUNDRY_AGENT_CONTAINER_IMAGE.") public class HostedAgentContainerSamplesTests extends ClientTestBase { private static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; + private static final String REMOTE_FILE_PATH_1 = "/remote/data_file1.txt"; + private static final String REMOTE_FILE_PATH_2 = "/remote/data_file2.txt"; static Stream getTestParameters() { List argumentsList = new ArrayList<>(); @@ -27,32 +54,151 @@ static Stream getTestParameters() { return argumentsList.stream(); } - @Disabled("Requires FOUNDRY_AGENT_CONTAINER_IMAGE: a prebuilt, pushed hosted-agent container image URI.") + @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") public void sessionsSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { - Assertions - .fail("Enable after providing FOUNDRY_AGENT_CONTAINER_IMAGE and recording hosted-agent session flow."); + AgentsClient agentsClient = getClientBuilder(httpClient, serviceVersion).buildAgentsClient(); + String image = getRequiredConfiguration("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME + "-sessions-test"; + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + AgentSessionResource session = resources.getSession(); + + AgentSessionResource fetched = agentsClient.getSession(agentName, session.getAgentSessionId()); + Assertions.assertNotNull(fetched); + Assertions.assertEquals(session.getAgentSessionId(), fetched.getAgentSessionId()); + + PagedIterable sessions = agentsClient.listSessions(agentName); + Assertions.assertTrue( + sessions.stream().anyMatch(item -> session.getAgentSessionId().equals(item.getAgentSessionId()))); + + agentsClient.deleteSession(agentName, session.getAgentSessionId()); + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } } - @Disabled("Requires FOUNDRY_AGENT_CONTAINER_IMAGE: a prebuilt, pushed hosted-agent container image URI.") + @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") public void sessionFilesSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { - Assertions.fail("Enable after providing FOUNDRY_AGENT_CONTAINER_IMAGE and recording session file flow."); + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + AgentsClient agentsClient = builder.buildAgentsClient(); + AgentSessionFilesClient sessionFilesClient = builder.buildAgentSessionFilesClient(); + String image = getRequiredConfiguration("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME + "-files-test"; + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + String sessionId = resources.getSession().getAgentSessionId(); + + sessionFilesClient.uploadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + BinaryData.fromString("Sample session file 1."), AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, + null); + sessionFilesClient.uploadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_2, + BinaryData.fromString("Sample session file 2."), AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, + null); + + SessionDirectoryListResponse files = sessionFilesClient.getSessionFiles(agentName, sessionId, "/remote", + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null); + Assertions.assertTrue( + files.getEntries().stream().map(SessionDirectoryEntry::getName).anyMatch("data_file1.txt"::equals)); + + BinaryData downloaded = sessionFilesClient.downloadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null); + String fileContent = new String(downloaded.toBytes(), StandardCharsets.UTF_8); + Assertions.assertEquals("Sample session file 1.", fileContent); + + sessionFilesClient.deleteSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, false, null); + sessionFilesClient.deleteSessionFile(agentName, sessionId, REMOTE_FILE_PATH_2, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, false, null); + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } } - @Disabled("Requires FOUNDRY_AGENT_CONTAINER_IMAGE: a prebuilt, pushed hosted-agent container image URI.") + @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") public void agentEndpointSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { - Assertions.fail("Enable after providing FOUNDRY_AGENT_CONTAINER_IMAGE and recording agent endpoint flow."); + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + AgentsClient agentsClient = builder.buildAgentsClient(); + String image = getRequiredConfiguration("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME + "-endpoint-test"; + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + configureAgentEndpoint(agentsClient, agentName, resources); + + OpenAIClient openAIClient = builder.buildAgentScopedOpenAIClient(agentName); + com.openai.models.responses.Response response = openAIClient.responses() + .create(ResponseCreateParams.builder() + .input("What is the size of France in square miles?") + .putAdditionalBodyProperty("agent_session_id", + JsonValue.from(resources.getSession().getAgentSessionId())) + .build()); + + Assertions.assertNotNull(response); + Assertions.assertFalse(response.output().isEmpty()); + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } } - @Disabled("Requires FOUNDRY_AGENT_CONTAINER_IMAGE: a prebuilt, pushed hosted-agent container image URI.") + @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") - public void sessionLogStreamSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { - Assertions.fail("Enable after providing FOUNDRY_AGENT_CONTAINER_IMAGE and recording session log stream flow."); + public void sessionLogStreamSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) throws IOException { + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + AgentsClient agentsClient = builder.buildAgentsClient(); + String image = getRequiredConfiguration("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME + "-logs-test"; + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + configureAgentEndpoint(agentsClient, agentName, resources); + + OpenAIClient openAIClient = builder.buildAgentScopedOpenAIClient(agentName); + com.openai.models.responses.Response openAIResponse = openAIClient.responses() + .create(ResponseCreateParams.builder() + .input("Say hello in one short sentence.") + .putAdditionalBodyProperty("agent_session_id", + JsonValue.from(resources.getSession().getAgentSessionId())) + .build()); + Assertions.assertNotNull(openAIResponse); + + com.azure.core.http.rest.Response rawStream + = agentsClient.getSessionLogStreamWithResponse(agentName, resources.getAgent().getVersion(), + resources.getSession().getAgentSessionId(), new RequestOptions()); + Assertions.assertNotNull(rawStream.getValue()); + HostedAgentsSampleUtils.printSseFrames(rawStream.getValue(), 5); + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } + } + + private static void configureAgentEndpoint(AgentsClient agentsClient, String agentName, + HostedAgentSessionResources resources) { + AgentEndpointConfig endpointConfig = new AgentEndpointConfig() + .setVersionSelector(new VersionSelector().setVersionSelectionRules(Collections + .singletonList(new FixedRatioVersionSelectionRule().setAgentVersion(resources.getAgent().getVersion()) + .setTrafficPercentage(100)))) + .setProtocols(Collections.singletonList(AgentEndpointProtocol.RESPONSES)); + + agentsClient.updateAgentDetails(agentName, new UpdateAgentDetailsOptions().setAgentEndpoint(endpointConfig), + AgentDefinitionOptInKeys.AGENT_ENDPOINT_V1_PREVIEW); + } + + private static String getRequiredConfiguration(String name) { + String value = Configuration.getGlobalConfiguration().get(name); + Assertions.assertNotNull(value, name + " must be set."); + return value; } } diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/toolboxes/ToolboxSamplesTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/toolboxes/ToolboxSamplesTests.java index 8c769670e420..5a86ddeed41a 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/toolboxes/ToolboxSamplesTests.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/toolboxes/ToolboxSamplesTests.java @@ -15,7 +15,6 @@ import com.azure.ai.agents.models.ToolboxVersionDetails; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; -import com.azure.core.test.annotation.LiveOnly; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -39,7 +38,6 @@ static Stream getTestParameters() { return argumentsList.stream(); } - @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") public void toolboxSearchToolboxSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { @@ -73,7 +71,6 @@ public void toolboxSearchToolboxSample(HttpClient httpClient, AgentsServiceVersi } } - @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") public void toolboxesAsyncSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesTests.java index eda638e6feaf..81787281fec4 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesTests.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesTests.java @@ -3,21 +3,38 @@ package com.azure.ai.agents.tools; +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClient; import com.azure.ai.agents.AgentsServiceVersion; import com.azure.ai.agents.ClientTestBase; +import com.azure.ai.agents.ResponsesAsyncClient; +import com.azure.ai.agents.ResponsesClient; +import com.azure.ai.agents.models.AgentReference; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.AzureCreateResponseOptions; +import com.azure.ai.agents.models.FabricIQPreviewTool; +import com.azure.ai.agents.models.PromptAgentDefinition; import com.azure.core.http.HttpClient; +import com.azure.core.util.Configuration; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Stream; import static com.azure.core.test.TestProxyTestBase.getHttpClients; +@Disabled("Requires FABRIC_IQ_PROJECT_CONNECTION_ID, which is missing from the current Java work resources.") public class FabricIQSamplesTests extends ClientTestBase { private static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; @@ -27,17 +44,79 @@ static Stream getTestParameters() { return argumentsList.stream(); } - @Disabled("Requires FABRIC_IQ_PROJECT_CONNECTION_ID and FOUNDRY_MODEL_NAME.") @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") public void fabricIqSyncSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { - Assertions.fail("Enable after providing FABRIC_IQ_PROJECT_CONNECTION_ID and FOUNDRY_MODEL_NAME."); + AgentsClient agentsClient = getClientBuilder(httpClient, serviceVersion).buildAgentsClient(); + ResponsesClient responsesClient = getClientBuilder(httpClient, serviceVersion).buildResponsesClient(); + String agentName = "fabric-iq-agent-test"; + + AgentVersionDetails agent = agentsClient.createAgentVersion(agentName, createAgentDefinition()); + Assertions.assertNotNull(agent); + Assertions.assertEquals(agentName, agent.getName()); + + try { + AgentReference agentReference = new AgentReference(agent.getName()).setVersion(agent.getVersion()); + Response response = responsesClient.createAzureResponse( + new AzureCreateResponseOptions().setAgentReference(agentReference), + ResponseCreateParams.builder().input("Use FabricIQ to summarize the available enterprise context.")); + + Assertions.assertNotNull(response); + Assertions.assertFalse(response.output().isEmpty()); + } finally { + agentsClient.deleteAgentVersion(agent.getName(), agent.getVersion()); + } } - @Disabled("Requires FABRIC_IQ_PROJECT_CONNECTION_ID and FOUNDRY_MODEL_NAME.") @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") public void fabricIqAsyncSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { - Assertions.fail("Enable after providing FABRIC_IQ_PROJECT_CONNECTION_ID and FOUNDRY_MODEL_NAME."); + AgentsAsyncClient agentsAsyncClient = getClientBuilder(httpClient, serviceVersion).buildAgentsAsyncClient(); + ResponsesAsyncClient responsesAsyncClient + = getClientBuilder(httpClient, serviceVersion).buildResponsesAsyncClient(); + String agentName = "fabric-iq-async-agent-test"; + AtomicReference agentRef = new AtomicReference<>(); + + Mono testFlow + = agentsAsyncClient.createAgentVersion(agentName, createAgentDefinition()).flatMap(agent -> { + agentRef.set(agent); + Assertions.assertEquals(agentName, agent.getName()); + AgentReference agentReference = new AgentReference(agent.getName()).setVersion(agent.getVersion()); + + return responsesAsyncClient.createAzureResponse( + new AzureCreateResponseOptions().setAgentReference(agentReference), ResponseCreateParams.builder() + .input("Use FabricIQ to summarize the available enterprise context.")); + }).doOnNext(response -> { + Assertions.assertNotNull(response); + Assertions.assertFalse(response.output().isEmpty()); + }).then(Mono.defer(() -> { + AgentVersionDetails agent = agentRef.get(); + if (agent == null) { + return Mono.empty(); + } + return agentsAsyncClient.deleteAgentVersion(agent.getName(), agent.getVersion()); + })); + + StepVerifier.create(testFlow).verifyComplete(); + } + + private static PromptAgentDefinition createAgentDefinition() { + String model = getRequiredConfiguration("FOUNDRY_MODEL_NAME"); + String fabricIqConnectionId = getRequiredConfiguration("FABRIC_IQ_PROJECT_CONNECTION_ID"); + + FabricIQPreviewTool fabricIqTool = new FabricIQPreviewTool(fabricIqConnectionId).setServerLabel("fabric_iq") + .setRequireApproval("never") + .setName("fabric_iq_lookup") + .setDescription("Use FabricIQ to answer questions grounded in enterprise data."); + + return new PromptAgentDefinition(model) + .setInstructions("You are a data assistant that can use FabricIQ for grounded enterprise answers.") + .setTools(Collections.singletonList(fabricIqTool)); + } + + private static String getRequiredConfiguration(String name) { + String value = Configuration.getGlobalConfiguration().get(name); + Assertions.assertNotNull(value, name + " must be set."); + return value; } } diff --git a/sdk/ai/azure-ai-projects/assets.json b/sdk/ai/azure-ai-projects/assets.json index dcc3df11c8e3..d20f4641c84e 100644 --- a/sdk/ai/azure-ai-projects/assets.json +++ b/sdk/ai/azure-ai-projects/assets.json @@ -1 +1 @@ -{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/ai/azure-ai-projects","Tag": "java/ai/azure-ai-projects_cd9e4bffa9"} \ No newline at end of file +{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/ai/azure-ai-projects","Tag": "java/ai/azure-ai-projects_616e5221de"} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/SamplesTests.java b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/SamplesTests.java index 25da419c09db..91d33bbff507 100644 --- a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/SamplesTests.java +++ b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/SamplesTests.java @@ -9,7 +9,6 @@ import com.azure.ai.projects.models.SkillDetails; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; -import com.azure.core.test.annotation.LiveOnly; import com.azure.core.util.BinaryData; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Assertions; @@ -30,26 +29,27 @@ public class SamplesTests extends ClientTestBase { private static final String SAMPLE_SKILL_NAME = "java-sample-skill-package-test"; + private static final String SAMPLE_SKILL_ASYNC_NAME = "java-sample-skill-package-async-test"; private static final FoundryFeaturesOptInKeys DATA_GENERATION_PREVIEW = FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW; - @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void skillsPackageSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) throws IOException { SkillsClient skillsClient = getClientBuilder(httpClient, serviceVersion).buildSkillsClient(); + String skillName = SAMPLE_SKILL_NAME; try { - skillsClient.deleteSkill(SAMPLE_SKILL_NAME); + skillsClient.deleteSkill(skillName); } catch (ResourceNotFoundException ignored) { // The sample skill does not already exist. } SkillDetails imported = null; try { - imported = skillsClient.createSkillFromPackage(createSkillPackage()); + imported = skillsClient.createSkillFromPackage(createSkillPackage(skillName)); Assertions.assertNotNull(imported); - Assertions.assertEquals(SAMPLE_SKILL_NAME, imported.getName()); + Assertions.assertEquals(skillName, imported.getName()); Assertions.assertTrue(imported.isBlobPresent()); SkillDetails fetched = skillsClient.getSkill(imported.getName()); @@ -64,28 +64,28 @@ public void skillsPackageSample(HttpClient httpClient, AIProjectsServiceVersion Files.write(downloadPath, downloaded.toBytes()); Assertions.assertTrue(Files.size(downloadPath) > 0); } finally { - String skillName = imported == null ? SAMPLE_SKILL_NAME : imported.getName(); + String importedSkillName = imported == null ? skillName : imported.getName(); try { - skillsClient.deleteSkill(skillName); + skillsClient.deleteSkill(importedSkillName); } catch (ResourceNotFoundException ignored) { // The skill may not have been created. } } } - @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void skillsPackageAsyncSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) throws IOException { SkillsAsyncClient skillsAsyncClient = getClientBuilder(httpClient, serviceVersion).buildSkillsAsyncClient(); + String skillName = SAMPLE_SKILL_ASYNC_NAME; - StepVerifier.create(skillsAsyncClient.deleteSkill(SAMPLE_SKILL_NAME) + StepVerifier.create(skillsAsyncClient.deleteSkill(skillName) .onErrorResume(ResourceNotFoundException.class, ignored -> reactor.core.publisher.Mono.empty()) - .then(skillsAsyncClient.createSkillFromPackage(createSkillPackage())) + .then(skillsAsyncClient.createSkillFromPackage(createSkillPackage(skillName))) .flatMap(imported -> { Assertions.assertNotNull(imported); - Assertions.assertEquals(SAMPLE_SKILL_NAME, imported.getName()); + Assertions.assertEquals(skillName, imported.getName()); Assertions.assertTrue(imported.isBlobPresent()); return skillsAsyncClient.getSkill(imported.getName()).doOnNext(fetched -> { @@ -98,7 +98,7 @@ public void skillsPackageAsyncSample(HttpClient httpClient, AIProjectsServiceVer })).verifyComplete(); } - @LiveOnly + @Disabled("The live service returns 400: API operation not supported for token authentication.") @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void dataGenerationJobsListSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { @@ -120,7 +120,7 @@ public void dataGenerationJobsListSample(HttpClient httpClient, AIProjectsServic } } - @LiveOnly + @Disabled("The live service returns 400: API operation not supported for token authentication.") @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void dataGenerationJobsListAsyncSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { @@ -137,7 +137,6 @@ public void dataGenerationJobsListAsyncSample(HttpClient httpClient, AIProjectsS .then()).verifyComplete(); } - @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void modelsListLatestSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { @@ -158,7 +157,6 @@ public void modelsListLatestSample(HttpClient httpClient, AIProjectsServiceVersi } } - @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void modelsListLatestAsyncSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { @@ -175,13 +173,13 @@ public void modelsListLatestAsyncSample(HttpClient httpClient, AIProjectsService Assertions.assertNotNull(sawModel); } - @Disabled("Requires FOUNDRY_MODEL_NAME and creates a long-running preview data generation job.") + @Disabled("Data generation live validation is blocked by 400: API operation not supported for token authentication; " + + "the create flow is also a long-running preview operation.") @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void dataGenerationCreateGetCancelDeleteSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { - Assertions.fail( - "Enable after providing FOUNDRY_MODEL_NAME and deciding whether to record this long-running preview flow."); + Assertions.fail("Enable after token-auth support is available for data generation jobs."); } @Disabled("Requires FOUNDRY_MODEL_ASSET_NAME, FOUNDRY_MODEL_ASSET_VERSION, and FOUNDRY_MODEL_BLOB_URI.") @@ -192,14 +190,16 @@ public void modelVersionCreateGetUpdateDeleteSample(HttpClient httpClient, Assertions.fail("Enable after providing model asset environment variables."); } - private static BinaryData createSkillPackage() throws IOException { - String skillMarkdown = "---\n" + "name: " + SAMPLE_SKILL_NAME + "\n" + private static BinaryData createSkillPackage(String skillName) throws IOException { + String skillMarkdown = "---\n" + "name: " + skillName + "\n" + "description: Answers product support questions using company policy and product guidance.\n" + "---\n\n" + "You help answer product support questions using company policy and product guidance.\n"; ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try (ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) { - zipOutputStream.putNextEntry(new ZipEntry(SAMPLE_SKILL_NAME + "/SKILL.md")); + ZipEntry skillEntry = new ZipEntry(skillName + "/SKILL.md"); + skillEntry.setTime(0); + zipOutputStream.putNextEntry(skillEntry); zipOutputStream.write(skillMarkdown.getBytes(StandardCharsets.UTF_8)); zipOutputStream.closeEntry(); } From 072b0c04120fb467b4828cdcab368042266ee9b4 Mon Sep 17 00:00:00 2001 From: Jose Alvarez Date: Tue, 19 May 2026 13:25:05 +0200 Subject: [PATCH 2/3] Enable hosted agent session sample recordings --- sdk/ai/azure-ai-agents/assets.json | 2 +- .../hostedagents/HostedAgentsSampleUtils.java | 24 ++++++++++++--- .../hostedagents/SessionsAsyncSample.java | 10 +++++-- .../agents/hostedagents/SessionsSample.java | 10 +++++-- .../com/azure/ai/agents/ClientTestBase.java | 1 + .../HostedAgentContainerSamplesTests.java | 29 ++++++++++++------- 6 files changed, 55 insertions(+), 21 deletions(-) diff --git a/sdk/ai/azure-ai-agents/assets.json b/sdk/ai/azure-ai-agents/assets.json index 251a4f74845e..fdda3e2d8016 100644 --- a/sdk/ai/azure-ai-agents/assets.json +++ b/sdk/ai/azure-ai-agents/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/ai/azure-ai-agents", - "Tag": "java/ai/azure-ai-agents_e191748df9" + "Tag": "java/ai/azure-ai-agents_8e39898979" } diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java index 81f2613349ea..4d06a24b572e 100644 --- a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java @@ -50,7 +50,9 @@ static HostedAgentSessionResources createAgentAndSession(AgentsClient agentsClie AgentVersionDetails agent = createHostedAgentVersion(agentsClient, agentName, image); waitForAgentVersionActive(agentsClient, agentName, agent.getVersion()); - AgentSessionResource session = agentsClient.createSession(agentName, new VersionRefIndicator(agent.getVersion())); + AgentSessionResource session = agentsClient.createSessionWithResponse(agentName, + BinaryData.fromObject(createSessionRequest(agent.getVersion())), foundryFeaturesRequestOptions()).getValue() + .toObject(AgentSessionResource.class); System.out.printf("Session created (id: %s, status: %s)%n", session.getAgentSessionId(), session.getStatus()); return new HostedAgentSessionResources(agent, session); @@ -60,7 +62,9 @@ static Mono createAgentAndSessionAsync(AgentsAsyncC String agentName, String image) { return createHostedAgentVersionAsync(agentsAsyncClient, agentName, image) .flatMap(agent -> waitForAgentVersionActiveAsync(agentsAsyncClient, agentName, agent.getVersion()) - .then(agentsAsyncClient.createSession(agentName, new VersionRefIndicator(agent.getVersion()))) + .then(agentsAsyncClient.createSessionWithResponse(agentName, + BinaryData.fromObject(createSessionRequest(agent.getVersion())), foundryFeaturesRequestOptions()) + .map(response -> response.getValue().toObject(AgentSessionResource.class))) .map(session -> { System.out.printf("Session created (id: %s, status: %s)%n", session.getAgentSessionId(), session.getStatus()); @@ -75,7 +79,8 @@ static void cleanup(AgentsClient agentsClient, String agentName, HostedAgentSess if (resources.getSession() != null) { try { - agentsClient.deleteSession(agentName, resources.getSession().getAgentSessionId()); + agentsClient.deleteSession(agentName, resources.getSession().getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW); System.out.printf("Session with id: %s deleted.%n", resources.getSession().getAgentSessionId()); } catch (ResourceNotFoundException ignored) { // The sample may have already deleted the session. @@ -101,7 +106,8 @@ static Mono cleanupAsync(AgentsAsyncClient agentsAsyncClient, String agent Mono deleteSession = Mono.empty(); if (resources.getSession() != null) { String sessionId = resources.getSession().getAgentSessionId(); - deleteSession = agentsAsyncClient.deleteSession(agentName, sessionId) + deleteSession = agentsAsyncClient.deleteSession(agentName, sessionId, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW) .doOnSuccess(unused -> System.out.printf("Session with id: %s deleted.%n", sessionId)) .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty()); } @@ -234,6 +240,16 @@ private static RequestOptions foundryFeaturesRequestOptions() { .setHeader(HttpHeaderName.fromString("Foundry-Features"), FOUNDRY_FEATURES_HEADER_VALUE); } + private static Map createSessionRequest(String agentVersion) { + Map versionIndicator = new HashMap<>(); + versionIndicator.put("agent_version", agentVersion); + versionIndicator.put("type", "version_ref"); + + Map request = new HashMap<>(); + request.put("version_indicator", versionIndicator); + return request; + } + private static Map sampleMetadata() { Map metadata = new HashMap<>(); metadata.put("enableVnextExperience", "true"); diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsAsyncSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsAsyncSample.java index ce64b3dd5a23..dec83bd8eefa 100644 --- a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsAsyncSample.java +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsAsyncSample.java @@ -6,6 +6,7 @@ import com.azure.ai.agents.AgentsAsyncClient; import com.azure.ai.agents.AgentsClientBuilder; import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; import com.azure.ai.agents.models.AgentSessionResource; import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; @@ -43,16 +44,19 @@ public static void main(String[] args) { resourcesRef.set(resources); AgentSessionResource session = resources.getSession(); - return agentsAsyncClient.getSession(agentName, session.getAgentSessionId()) + return agentsAsyncClient.getSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW) .doOnNext(fetched -> System.out.printf("Retrieved session (id: %s, status: %s)%n", fetched.getAgentSessionId(), fetched.getStatus())) - .thenMany(agentsAsyncClient.listSessions(agentName) + .thenMany(agentsAsyncClient.listSessions(agentName, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null, null, null, null) .doOnSubscribe(unused -> System.out.println("Listing sessions for the agent...")) .doOnNext(item -> System.out.printf(" - %s (status: %s)%n", item.getAgentSessionId(), item.getStatus()))) .then(Mono.defer(() -> { System.out.printf("Deleting session with id: %s...%n", session.getAgentSessionId()); - return agentsAsyncClient.deleteSession(agentName, session.getAgentSessionId()) + return agentsAsyncClient.deleteSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW) .doOnSuccess(unused -> System.out.printf("Session with id: %s deleted.%n", session.getAgentSessionId())); })); diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsSample.java index 0a76124efac0..66592c531b3c 100644 --- a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsSample.java +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsSample.java @@ -6,6 +6,7 @@ import com.azure.ai.agents.AgentsClient; import com.azure.ai.agents.AgentsClientBuilder; import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; import com.azure.ai.agents.models.AgentSessionResource; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Configuration; @@ -38,18 +39,21 @@ public static void main(String[] args) { resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); AgentSessionResource session = resources.getSession(); - AgentSessionResource fetched = agentsClient.getSession(agentName, session.getAgentSessionId()); + AgentSessionResource fetched = agentsClient.getSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW); System.out.printf("Retrieved session (id: %s, status: %s)%n", fetched.getAgentSessionId(), fetched.getStatus()); System.out.println("Listing sessions for the agent..."); - PagedIterable sessions = agentsClient.listSessions(agentName); + PagedIterable sessions = agentsClient.listSessions(agentName, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null, null, null, null); for (AgentSessionResource item : sessions) { System.out.printf(" - %s (status: %s)%n", item.getAgentSessionId(), item.getStatus()); } System.out.printf("Deleting session with id: %s...%n", session.getAgentSessionId()); - agentsClient.deleteSession(agentName, session.getAgentSessionId()); + agentsClient.deleteSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW); System.out.printf("Session with id: %s deleted.%n", session.getAgentSessionId()); } finally { HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/ClientTestBase.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/ClientTestBase.java index 04ea90051026..0918fd289afb 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/ClientTestBase.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/ClientTestBase.java @@ -98,6 +98,7 @@ private void addTestRecordCustomSanitizers() { ArrayList sanitizers = new ArrayList<>(); sanitizers.add(new TestProxySanitizer("$..key", null, "REDACTED", TestProxySanitizerType.BODY_KEY)); + sanitizers.add(new TestProxySanitizer("$..image", null, "REDACTED", TestProxySanitizerType.BODY_KEY)); sanitizers.add(new TestProxySanitizer("(?<=./)([^?]+)", "/REDACTED/", TestProxySanitizerType.URL)); sanitizers.add(new TestProxySanitizer("Content-Type", "(^multipart\\/form-data; boundary=[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{2})", diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/HostedAgentContainerSamplesTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/HostedAgentContainerSamplesTests.java index 18b78688ee57..2070ec61d473 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/HostedAgentContainerSamplesTests.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/HostedAgentContainerSamplesTests.java @@ -18,10 +18,11 @@ import com.azure.ai.agents.models.SessionDirectoryListResponse; import com.azure.ai.agents.models.UpdateAgentDetailsOptions; import com.azure.ai.agents.models.VersionSelector; +import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; -import com.azure.core.test.annotation.LiveOnly; +import com.azure.core.test.TestMode; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; import com.openai.client.OpenAIClient; @@ -42,7 +43,6 @@ import static com.azure.core.test.TestProxyTestBase.getHttpClients; -@Disabled("Hosted agent version provisioning failed with the current FOUNDRY_AGENT_CONTAINER_IMAGE.") public class HostedAgentContainerSamplesTests extends ClientTestBase { private static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; private static final String REMOTE_FILE_PATH_1 = "/remote/data_file1.txt"; @@ -54,7 +54,6 @@ static Stream getTestParameters() { return argumentsList.stream(); } - @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") public void sessionsSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { @@ -67,21 +66,27 @@ public void sessionsSample(HttpClient httpClient, AgentsServiceVersion serviceVe resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); AgentSessionResource session = resources.getSession(); - AgentSessionResource fetched = agentsClient.getSession(agentName, session.getAgentSessionId()); + AgentSessionResource fetched = agentsClient.getSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW); Assertions.assertNotNull(fetched); Assertions.assertEquals(session.getAgentSessionId(), fetched.getAgentSessionId()); - PagedIterable sessions = agentsClient.listSessions(agentName); + PagedIterable sessions = agentsClient.listSessions(agentName, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null, null, null, null); Assertions.assertTrue( sessions.stream().anyMatch(item -> session.getAgentSessionId().equals(item.getAgentSessionId()))); - agentsClient.deleteSession(agentName, session.getAgentSessionId()); + try { + agentsClient.deleteSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW); + } catch (ResourceNotFoundException ignored) { + // The session may already be deleted by the service. + } } finally { HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); } } - @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") public void sessionFilesSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { @@ -122,7 +127,7 @@ public void sessionFilesSample(HttpClient httpClient, AgentsServiceVersion servi } } - @LiveOnly + @Disabled("Agent-scoped OpenAI Responses invocation returns 400: API version not supported.") @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") public void agentEndpointSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { @@ -151,7 +156,7 @@ public void agentEndpointSample(HttpClient httpClient, AgentsServiceVersion serv } } - @LiveOnly + @Disabled("Agent-scoped OpenAI Responses invocation returns 400: API version not supported.") @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("getTestParameters") public void sessionLogStreamSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) throws IOException { @@ -196,7 +201,11 @@ private static void configureAgentEndpoint(AgentsClient agentsClient, String age AgentDefinitionOptInKeys.AGENT_ENDPOINT_V1_PREVIEW); } - private static String getRequiredConfiguration(String name) { + private String getRequiredConfiguration(String name) { + if (getTestMode() == TestMode.PLAYBACK && "FOUNDRY_AGENT_CONTAINER_IMAGE".equals(name)) { + return "REDACTED"; + } + String value = Configuration.getGlobalConfiguration().get(name); Assertions.assertNotNull(value, name + " must be set."); return value; From 90f66f6e03c13439ebe58f59521f210497092fe5 Mon Sep 17 00:00:00 2001 From: Jose Alvarez Date: Tue, 19 May 2026 14:00:43 +0200 Subject: [PATCH 3/3] Fix hosted agent sample import --- .../azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java index 4d06a24b572e..9a725dc63b15 100644 --- a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java @@ -13,7 +13,6 @@ import com.azure.ai.agents.models.CreateAgentVersionInput; import com.azure.ai.agents.models.HostedAgentDefinition; import com.azure.ai.agents.models.ProtocolVersionRecord; -import com.azure.ai.agents.models.VersionRefIndicator; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.RequestOptions;