diff --git a/sdk/ai/Azure.AI.Agents/README.md b/sdk/ai/Azure.AI.Agents/README.md index 7d8202005f22..81192989ba36 100644 --- a/sdk/ai/Azure.AI.Agents/README.md +++ b/sdk/ai/Azure.AI.Agents/README.md @@ -1,5 +1,10 @@ # Azure AI Agents client library for .NET +> [!WARNING] +> This feature branch folder is outdated and pending removal. +> +> Please refer to the `Azure.AI.Projects` and `Azure.AI.Projects.OpenAI` folders for the up-to-date code and information about Agents. + Develop Agents using the Azure AI Foundry platform, leveraging an extensive ecosystem of models, tools, and capabilities from OpenAI, Microsoft, and other LLM providers. **Note:** While this package can be used independently, we recommend using the Azure AI Projects client library (Azure.AI.Projects) for enhanced experience. The Projects library provides simplified access to advanced functionality, such as creating and managing Agents, enumerating AI models, working with datasets, managing search indexes, evaluating generative AI performance, and enabling OpenTelemetry tracing. @@ -24,7 +29,7 @@ Develop Agents using the Azure AI Foundry platform, leveraging an extensive ecos - [Prompt Agents](#prompt-agents) - [Agents](#agents) - [Responses](#responses) - - [Coversations](#coversations) + - [Conversations](#Conversations) - [Container App](#container-app) - [File search](#file-search) - [Code interpreter](#code-interpreter) @@ -250,7 +255,7 @@ Finally, we need to remove the `AgentVersion` object. await agentClient.DeleteAgentAsync(agentName: "myAgent"); ``` -#### Coversations +#### Conversations Conversations may be used to store the previous conversation with the agent. To add the responses to a conversation, set the conversation ID to the `ResponseCreationOptions`. diff --git a/sdk/ai/Azure.AI.Agents/samples/Sample1_Agent_Versions.md b/sdk/ai/Azure.AI.Agents/samples/Sample1_Agent_Versions.md index b93024c2bf24..dd60401a7e13 100644 --- a/sdk/ai/Azure.AI.Agents/samples/Sample1_Agent_Versions.md +++ b/sdk/ai/Azure.AI.Agents/samples/Sample1_Agent_Versions.md @@ -57,17 +57,17 @@ await foreach (AgentVersion oneAgentVersion in agentVersions) 4. To communicate with the agent, we will need to create a conversation. Synchronous sample: -```C# Snippet:Sample_CreateCoversation_Sync_2 -ConversationClient coversations = client.GetConversationClient(); -AgentConversation conversation = coversations.CreateConversation(); +```C# Snippet:Sample_CreateConversation_Sync_2 +ConversationClient Conversations = client.GetConversationClient(); +AgentConversation conversation = Conversations.CreateConversation(); ModelReaderWriterOptions options = new("W"); BinaryData conversationBin = ((IPersistableModel)conversation).Write(options); ``` Asynchronous sample: -```C# Snippet:Sample_CreateCoversation_Async_2 -ConversationClient coversations = client.GetConversationClient(); -AgentConversation conversation = await coversations.CreateConversationAsync(); +```C# Snippet:Sample_CreateConversation_Async_2 +ConversationClient Conversations = client.GetConversationClient(); +AgentConversation conversation = await Conversations.CreateConversationAsync(); ModelReaderWriterOptions options = new("W"); BinaryData conversationBin = ((IPersistableModel)conversation).Write(options); ``` @@ -129,12 +129,12 @@ Console.WriteLine(response.GetOutputText()); Synchronous sample: ```C# Snippet:Sample_Cleanup_Sync_2 -coversations.DeleteConversation(conversationId: conversation.Id); +Conversations.DeleteConversation(conversationId: conversation.Id); client.DeleteAgentVersion(agentName: agentVersion.Name, agentVersion: agentVersion.Version); ``` Asynchronous sample: ```C# Snippet:Sample_Cleanup_Async_2 -await coversations.DeleteConversationAsync(conversationId: conversation.Id); +await Conversations.DeleteConversationAsync(conversationId: conversation.Id); await client.DeleteAgentVersionAsync(agentName: agentVersion.Name, agentVersion: agentVersion.Version); ``` diff --git a/sdk/ai/Azure.AI.Agents/tests/Samples/Sample_CreateAgentVersion.cs b/sdk/ai/Azure.AI.Agents/tests/Samples/Sample_CreateAgentVersion.cs index f7a93e95fee8..9e4332e392f4 100644 --- a/sdk/ai/Azure.AI.Agents/tests/Samples/Sample_CreateAgentVersion.cs +++ b/sdk/ai/Azure.AI.Agents/tests/Samples/Sample_CreateAgentVersion.cs @@ -48,9 +48,9 @@ public async Task CreateAgentVersionAsync() } #endregion - #region Snippet:Sample_CreateCoversation_Async_2 - ConversationClient coversations = client.GetConversationClient(); - AgentConversation conversation = await coversations.CreateConversationAsync(); + #region Snippet:Sample_CreateConversation_Async_2 + ConversationClient Conversations = client.GetConversationClient(); + AgentConversation conversation = await Conversations.CreateConversationAsync(); ModelReaderWriterOptions options = new("W"); BinaryData conversationBin = ((IPersistableModel)conversation).Write(options); #endregion @@ -77,7 +77,7 @@ public async Task CreateAgentVersionAsync() Console.WriteLine(response.GetOutputText()); #endregion #region Snippet:Sample_Cleanup_Async_2 - await coversations.DeleteConversationAsync(conversationId: conversation.Id); + await Conversations.DeleteConversationAsync(conversationId: conversation.Id); await client.DeleteAgentVersionAsync(agentName: agentVersion.Name, agentVersion: agentVersion.Version); #endregion } @@ -112,9 +112,9 @@ public void CreateAgentVersion() } #endregion - #region Snippet:Sample_CreateCoversation_Sync_2 - ConversationClient coversations = client.GetConversationClient(); - AgentConversation conversation = coversations.CreateConversation(); + #region Snippet:Sample_CreateConversation_Sync_2 + ConversationClient Conversations = client.GetConversationClient(); + AgentConversation conversation = Conversations.CreateConversation(); ModelReaderWriterOptions options = new("W"); BinaryData conversationBin = ((IPersistableModel)conversation).Write(options); #endregion @@ -142,7 +142,7 @@ public void CreateAgentVersion() Console.WriteLine(response.GetOutputText()); #endregion #region Snippet:Sample_Cleanup_Sync_2 - coversations.DeleteConversation(conversationId: conversation.Id); + Conversations.DeleteConversation(conversationId: conversation.Id); client.DeleteAgentVersion(agentName: agentVersion.Name, agentVersion: agentVersion.Version); #endregion } diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/CHANGELOG.md b/sdk/ai/Azure.AI.Projects.OpenAI/CHANGELOG.md index 3760cadf3a12..67cec38263af 100644 --- a/sdk/ai/Azure.AI.Projects.OpenAI/CHANGELOG.md +++ b/sdk/ai/Azure.AI.Projects.OpenAI/CHANGELOG.md @@ -1,6 +1,12 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.3 (2025-11-15) + +### Bugs Fixed + +- Addressed an issue that caused paginated responses like conversation items to never terminate when large numbers of items are fetched + +## 1.0.0-beta.3 (2025-11-14) ### Features Added @@ -12,7 +18,7 @@ ## 1.0.0-beta.2 (2025-11-14) -### Bugs fixed +### Bugs Fixed - Addressed a problem where not supplying an options instance to the `ProjectResponsesClient` constructor resulted in fallback to the `https://api.openai.com/v1` endpoint diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/README.md b/sdk/ai/Azure.AI.Projects.OpenAI/README.md index c2d07b216681..b59a6976fdf0 100644 --- a/sdk/ai/Azure.AI.Projects.OpenAI/README.md +++ b/sdk/ai/Azure.AI.Projects.OpenAI/README.md @@ -24,7 +24,7 @@ Develop Agents using the Azure AI Foundry platform, leveraging an extensive ecos - [Prompt Agents](#prompt-agents) - [Agents](#agents) - [Responses](#responses) - - [Coversations](#coversations) + - [Conversations](#Conversations) - [Container App](#container-app) - [File search](#file-search) - [Code interpreter](#code-interpreter) diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/assets.json b/sdk/ai/Azure.AI.Projects.OpenAI/assets.json index 338bd8893199..c6c3de221018 100644 --- a/sdk/ai/Azure.AI.Projects.OpenAI/assets.json +++ b/sdk/ai/Azure.AI.Projects.OpenAI/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/ai/Azure.AI.Projects.OpenAI", - "Tag": "net/ai/Azure.AI.Projects.OpenAI_8a364fa4af" + "Tag": "net/ai/Azure.AI.Projects.OpenAI_ed5f3bf439" } diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample5_MemorySearchTool.md b/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample5_MemorySearchTool.md index bcf34d07ca96..c0c21090e28a 100644 --- a/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample5_MemorySearchTool.md +++ b/sdk/ai/Azure.AI.Projects.OpenAI/samples/Sample5_MemorySearchTool.md @@ -58,12 +58,12 @@ OpenAIResponse response = await responseClient.CreateResponseAsync([request]); Synchronous sample: ```C# Snippet:Sample_WriteOutput_MemoryTool_Sync string scope = "Joke from conversation"; -List updateItems = [request]; +MemoryUpdateOptions memoryOptions = new(scope); +memoryOptions.Items.Add(request); Assert.That(response.Status, Is.EqualTo(ResponseStatus.Completed)); - foreach (ResponseItem item in response.OutputItems) { - updateItems.Add(item); + memoryOptions.Items.Add(item); } Console.WriteLine(response.GetOutputText()); ``` @@ -71,7 +71,8 @@ Console.WriteLine(response.GetOutputText()); Asynchronous sample: ```C# Snippet:Sample_WriteOutput_MemoryTool_Async string scope = "Joke from conversation"; -List updateItems = [request]; +MemoryUpdateOptions memoryOptions = new(scope); +memoryOptions.Items.Add(request); while (response.Status != ResponseStatus.Incomplete && response.Status != ResponseStatus.Failed && response.Status != ResponseStatus.Completed){ await Task.Delay(TimeSpan.FromMilliseconds(500)); response = await responseClient.GetResponseAsync(responseId: response.Id); @@ -80,7 +81,7 @@ Assert.That(response.Status, Is.EqualTo(ResponseStatus.Completed)); foreach (ResponseItem item in response.OutputItems) { - updateItems.Add(item); + memoryOptions.Items.Add(item); } Console.WriteLine(response.GetOutputText()); ``` @@ -98,12 +99,12 @@ MemoryStore memoryStore = projectClient.MemoryStores.CreateMemoryStore( definition: memoryStoreDefinition, description: "Memory store for conversation." ); -MemoryUpdateOptions updateOptions = new(scope); -foreach (ResponseItem updateItem in updateItems) +MemoryUpdateResult updateResult = projectClient.MemoryStores.UpdateMemories(memoryStoreName: memoryStore.Name, options: memoryOptions); +while (updateResult.Status != MemoryStoreUpdateStatus.Failed && updateResult.Status != MemoryStoreUpdateStatus.Completed) { - updateOptions.Items.Add(updateItem); + Thread.Sleep(TimeSpan.FromMilliseconds(500)); + updateResult = await projectClient.MemoryStores.GetUpdateResultAsync(memoryStore.Name, updateResult.UpdateId); } -projectClient.MemoryStores.UpdateMemories(memoryStoreName: memoryStore.Name, options: updateOptions); ``` Asynchronous sample: @@ -117,7 +118,12 @@ MemoryStore memoryStore = await projectClient.MemoryStores.CreateMemoryStoreAsyn definition: memoryStoreDefinition, description: "Memory store for conversation." ); -projectClient.MemoryStores.UpdateMemories(memoryStore.Name, new MemoryUpdateOptions(scope)); +MemoryUpdateResult updateResult = await projectClient.MemoryStores.UpdateMemoriesAsync(memoryStoreName: memoryStore.Name, options: memoryOptions); +while (updateResult.Status != MemoryStoreUpdateStatus.Failed && updateResult.Status != MemoryStoreUpdateStatus.Completed) +{ + await Task.Delay(TimeSpan.FromMilliseconds(500)); + updateResult = await projectClient.MemoryStores.GetUpdateResultAsync(memoryStore.Name, updateResult.UpdateId); +} ``` 7. Check that the memory store contain the relevant memories. diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/src/Azure.AI.Projects.OpenAI.csproj b/sdk/ai/Azure.AI.Projects.OpenAI/src/Azure.AI.Projects.OpenAI.csproj index 39557736ed4f..abbe449317b1 100644 --- a/sdk/ai/Azure.AI.Projects.OpenAI/src/Azure.AI.Projects.OpenAI.csproj +++ b/sdk/ai/Azure.AI.Projects.OpenAI/src/Azure.AI.Projects.OpenAI.csproj @@ -8,7 +8,7 @@ ongoing forward compatibility. Microsoft Foundry OpenAI .NET Extensions - 1.0.0-beta.2 + 1.0.0-beta.3 Azure.AI.Projects.OpenAI $(RequiredTargetFrameworks) $(NoWarn);OPENAI001;CS1591;AZC0007;AZC0012;AZC0015;AZC0030;AZC0031;AZC0034;SA1649;SA1402;AZC0035 diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/src/Custom/Internal/InternalOpenAICollectionResultOptions.cs b/sdk/ai/Azure.AI.Projects.OpenAI/src/Custom/Internal/InternalOpenAICollectionResultOptions.cs index 303ae3f9b19d..a8e5e47cd72c 100644 --- a/sdk/ai/Azure.AI.Projects.OpenAI/src/Custom/Internal/InternalOpenAICollectionResultOptions.cs +++ b/sdk/ai/Azure.AI.Projects.OpenAI/src/Custom/Internal/InternalOpenAICollectionResultOptions.cs @@ -57,8 +57,8 @@ public InternalOpenAICollectionResultOptions GetCloneForPage(InternalOpenAIPa ParentResourceId = ParentResourceId, Limit = Limit, Order = Order, - AfterId = AfterId, - BeforeId = BeforeId, + AfterId = page.LastId, + BeforeId = page.FirstId, }; clonedOptions.Filters.AddRange(Filters); clonedOptions.Includes.AddRange(Includes); diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/tests/ConversationsTests.cs b/sdk/ai/Azure.AI.Projects.OpenAI/tests/ConversationsTests.cs index f6b931f5ea81..6e08407e748b 100644 --- a/sdk/ai/Azure.AI.Projects.OpenAI/tests/ConversationsTests.cs +++ b/sdk/ai/Azure.AI.Projects.OpenAI/tests/ConversationsTests.cs @@ -4,12 +4,13 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; +using Azure.AI.Projects.OpenAI; using Microsoft.ClientModel.TestFramework; using NUnit.Framework; -using Azure.AI.Projects.OpenAI; using OpenAI; using OpenAI.Files; using OpenAI.Responses; @@ -106,4 +107,82 @@ public async Task ConversationOperationsWork() } } } + + [RecordedTest] + public async Task ConversationItemPaginationWorks() + { + ProjectOpenAIClient client = GetTestProjectOpenAIClient(); + + // Create a conversation + ProjectConversation conversation = await client.Conversations.CreateProjectConversationAsync(); + Assert.That(conversation?.Id, Does.StartWith("conv_")); + + // Create 40 messages for the conversation + List messagesToAdd = new(); + for (int i = 1; i <= 40; i++) + { + messagesToAdd.Add(ResponseItem.CreateUserMessageItem($"Message {i}")); + } + + // Trying to add all 40 at once should fail + ClientResultException exceptionFromOperation = Assert.ThrowsAsync(async () => _ = await client.Conversations.CreateProjectConversationItemsAsync(conversation.Id, messagesToAdd)); + Assert.That(exceptionFromOperation.GetRawResponse().Content.ToString(), Does.Contain("20 items")); + + List firstHalfMessages = []; + for (int i = 0; i < 20; i++) + { + firstHalfMessages.Add(messagesToAdd[i]); + } + List secondHalfMessages = []; + for (int i = 20; i < messagesToAdd.Count; i++) + { + secondHalfMessages.Add(messagesToAdd[i]); + } + + ReadOnlyCollection createdItems = await client.Conversations.CreateProjectConversationItemsAsync( + conversation.Id, + firstHalfMessages); + Assert.That(createdItems, Has.Count.EqualTo(20)); + createdItems = await client.Conversations.CreateProjectConversationItemsAsync(conversation.Id, secondHalfMessages); + Assert.That(createdItems, Has.Count.EqualTo(20)); + + // Test ascending order traversal + List ascendingItems = []; + await foreach (AgentResponseItem item in client.Conversations.GetProjectConversationItemsAsync( + conversation.Id, + limit: 5, + order: "asc")) + { + ascendingItems.Add(item); + } + Assert.That(ascendingItems, Has.Count.EqualTo(40)); + + // Test descending order traversal + List descendingItems = []; + await foreach (AgentResponseItem item in client.Conversations.GetProjectConversationItemsAsync( + conversation.Id, + limit: 5, + order: "desc")) + { + descendingItems.Add(item); + } + Assert.That(descendingItems, Has.Count.EqualTo(40)); + + // Verify that ascending and descending lists contain the same items but in reverse order + descendingItems.Reverse(); + Assert.That(ascendingItems.Count, Is.EqualTo(descendingItems.Count)); + for (int i = 0; i < ascendingItems.Count; i++) + { + Assert.That(ascendingItems[i].Id, Is.EqualTo(descendingItems[i].Id), + $"Item at position {i} should be the same in both orderings"); + } + + // Verify that we can collect all items consistently + List allItems = []; + await foreach (AgentResponseItem item in client.Conversations.GetProjectConversationItemsAsync(conversation.Id)) + { + allItems.Add(item); + } + Assert.That(allItems, Has.Count.EqualTo(40)); + } } diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/tests/OtherOpenAIParityTests.cs b/sdk/ai/Azure.AI.Projects.OpenAI/tests/OtherOpenAIParityTests.cs index 04433849f186..120761e1a461 100644 --- a/sdk/ai/Azure.AI.Projects.OpenAI/tests/OtherOpenAIParityTests.cs +++ b/sdk/ai/Azure.AI.Projects.OpenAI/tests/OtherOpenAIParityTests.cs @@ -23,12 +23,7 @@ public OtherOpenAIParityTests(bool isAsync) : base(isAsync) [TestCase(OpenAIClientMode.UseFDPOpenAI, "fine-tune")] public async Task FileUploadWorks(OpenAIClientMode clientMode, string rawPurpose) { - OpenAIClient openAIClient = clientMode switch - { - OpenAIClientMode.UseExternalOpenAI => GetTestBaseOpenAIClient(), - OpenAIClientMode.UseFDPOpenAI => GetTestProjectOpenAIClient(), - _ => throw new NotImplementedException() - }; + OpenAIClient openAIClient = GetTestOpenAIClient(clientMode); OpenAIFileClient fileClient = openAIClient.GetOpenAIFileClient(); (string filename, string rawFileData) = rawPurpose switch diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/tests/ProjectsOpenAITestBase.cs b/sdk/ai/Azure.AI.Projects.OpenAI/tests/ProjectsOpenAITestBase.cs index 7ee415fb0309..bcf1d6535ef3 100644 --- a/sdk/ai/Azure.AI.Projects.OpenAI/tests/ProjectsOpenAITestBase.cs +++ b/sdk/ai/Azure.AI.Projects.OpenAI/tests/ProjectsOpenAITestBase.cs @@ -125,6 +125,37 @@ protected OpenAIClient GetTestBaseOpenAIClient(Uri overrideEndpoint = null) options)); } + protected OpenAIResponseClient GetTestBaseResponsesClient(Uri overrideEndpoint = null, string overrideModel = null) + { + OpenAIClientOptions options = CreateTestOpenAIClientOptions(overrideEndpoint); + + return CreateProxyFromClient( + new OpenAIResponseClient( + overrideModel ?? TestEnvironment.MODELDEPLOYMENTNAME, + new ApiKeyCredential(TestEnvironment.PARITY_OPENAI_API_KEY), + options)); + } + + protected OpenAIClient GetTestOpenAIClient(OpenAIClientMode clientMode) + { + return clientMode switch + { + OpenAIClientMode.UseFDPOpenAI => GetTestProjectOpenAIClient(), + OpenAIClientMode.UseExternalOpenAI => GetTestBaseOpenAIClient(), + _ => throw new NotImplementedException() + }; + } + + protected OpenAIResponseClient GetTestResponsesClient(OpenAIClientMode clientMode, string overrideModel = null) + { + return clientMode switch + { + OpenAIClientMode.UseFDPOpenAI => GetTestProjectResponsesClient(defaultModelName: overrideModel), + OpenAIClientMode.UseExternalOpenAI => GetTestBaseResponsesClient(overrideModel: overrideModel), + _ => throw new NotImplementedException(), + }; + } + private AuthenticationTokenProvider GetTestAuthenticationProvider() { // For local testing if you are using non default account diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/tests/ResponsesParityTests.cs b/sdk/ai/Azure.AI.Projects.OpenAI/tests/ResponsesParityTests.cs index a2cd2c3e3b68..982bbedbda48 100644 --- a/sdk/ai/Azure.AI.Projects.OpenAI/tests/ResponsesParityTests.cs +++ b/sdk/ai/Azure.AI.Projects.OpenAI/tests/ResponsesParityTests.cs @@ -10,10 +10,10 @@ using Microsoft.ClientModel.TestFramework; using NUnit.Framework; using Azure.AI.Projects.OpenAI; -using OpenAI; using OpenAI.Files; using OpenAI.Responses; using OpenAI.VectorStores; +using OpenAI.Realtime; namespace Azure.AI.Projects.OpenAI.Tests; @@ -231,7 +231,6 @@ public async Task FunctionToolWorks() } [RecordedTest] - // [AsyncOnly] public async Task StreamingResponsesWork() { ProjectOpenAIClient client = GetTestProjectOpenAIClient(); @@ -305,23 +304,34 @@ public async Task ResponseBackgroundModeWorks() } [RecordedTest] - [Ignore("Bug 4755034")] - public async Task GetResponseStreamingWorks() + [TestCase(OpenAIClientMode.UseFDPOpenAI, Ignore = "Issue 4823408")] + [TestCase(OpenAIClientMode.UseExternalOpenAI)] + public async Task GetResponseStreamingWorks(OpenAIClientMode clientMode) { - ProjectOpenAIClient client = GetTestProjectOpenAIClient(); + OpenAIResponseClient client = GetTestResponsesClient(clientMode); - OpenAIResponse response = await client.Responses.CreateResponseAsync( - [ResponseItem.CreateUserMessageItem("Hello, model!")], - new ResponseCreationOptions() + OpenAIResponse startedResponse = null; + await foreach (StreamingResponseUpdate update + in client.CreateResponseStreamingAsync( + "Hello, model!", + new ResponseCreationOptions() + { + Model = TestEnvironment.MODELDEPLOYMENTNAME, + BackgroundModeEnabled = true, + })) + { + if (update is StreamingResponseCreatedUpdate createdUpdate) { - Model = TestEnvironment.MODELDEPLOYMENTNAME, - BackgroundModeEnabled = true, - }); - Assert.That(response?.Id, Is.Not.Null.And.Not.Empty); - Assert.That(response.Status, Is.EqualTo(ResponseStatus.Queued).Or.EqualTo(ResponseStatus.InProgress)); + startedResponse = createdUpdate.Response; + break; + } + } + + Assert.That(startedResponse?.Id, Is.Not.Null.And.Not.Empty); + Assert.That(startedResponse.Status, Is.EqualTo(ResponseStatus.Queued).Or.EqualTo(ResponseStatus.InProgress)); List streamedUpdates = []; - await foreach (StreamingResponseUpdate responseUpdate in client.Responses.GetResponseStreamingAsync(response.Id)) + await foreach (StreamingResponseUpdate responseUpdate in client.GetResponseStreamingAsync(startedResponse.Id)) { streamedUpdates.Add(responseUpdate); } @@ -487,4 +497,24 @@ public async Task DirectlyInitializedResponsesClientsWork( Assert.That(response?.Id, Is.Not.Null.And.Not.Empty); Assert.That(response?.OutputItems, Has.Count.GreaterThan(0)); } + + [RecordedTest] + [TestCase(OpenAIClientMode.UseExternalOpenAI)] + [TestCase(OpenAIClientMode.UseFDPOpenAI, Ignore = "'none' not yet supported on FDP")] + public async Task ExtensibleReasoningEffortWorks(OpenAIClientMode clientMode) + { + OpenAIResponseClient responseClient = GetTestResponsesClient(clientMode, "gpt-5.1"); + + OpenAIResponse response = await responseClient.CreateResponseAsync( + "Hello, gpt-5.1!", + new ResponseCreationOptions() + { + ReasoningOptions = new() + { + ReasoningEffortLevel = "none", + }, + }); + + Assert.That(response.ReasoningOptions?.ReasoningEffortLevel?.ToString(), Is.EqualTo("none")); + } } diff --git a/sdk/ai/Azure.AI.Projects.OpenAI/tests/Samples/Sample_MemorySearchTool.cs b/sdk/ai/Azure.AI.Projects.OpenAI/tests/Samples/Sample_MemorySearchTool.cs index 150dfb9ff18a..16ddb691e4c1 100644 --- a/sdk/ai/Azure.AI.Projects.OpenAI/tests/Samples/Sample_MemorySearchTool.cs +++ b/sdk/ai/Azure.AI.Projects.OpenAI/tests/Samples/Sample_MemorySearchTool.cs @@ -43,9 +43,7 @@ public async Task MemorySearchToolAsync() agentName: "myAgent", options: new(agentDefinition)); #endregion - #region Snippet:Sample_CreateConversation_MemoryTool_Async - ProjectResponsesClient responseClient = projectClient.OpenAI.GetProjectResponsesClientForAgent(agentVersion.Name); ResponseItem request = ResponseItem.CreateUserMessageItem("Hello, tell me a joke."); @@ -54,7 +52,8 @@ public async Task MemorySearchToolAsync() #region Snippet:Sample_WriteOutput_MemoryTool_Async string scope = "Joke from conversation"; - List updateItems = [request]; + MemoryUpdateOptions memoryOptions = new(scope); + memoryOptions.Items.Add(request); while (response.Status != ResponseStatus.Incomplete && response.Status != ResponseStatus.Failed && response.Status != ResponseStatus.Completed){ await Task.Delay(TimeSpan.FromMilliseconds(500)); response = await responseClient.GetResponseAsync(responseId: response.Id); @@ -63,7 +62,7 @@ public async Task MemorySearchToolAsync() foreach (ResponseItem item in response.OutputItems) { - updateItems.Add(item); + memoryOptions.Items.Add(item); } Console.WriteLine(response.GetOutputText()); #endregion @@ -77,7 +76,12 @@ public async Task MemorySearchToolAsync() definition: memoryStoreDefinition, description: "Memory store for conversation." ); - projectClient.MemoryStores.UpdateMemories(memoryStore.Name, new MemoryUpdateOptions(scope)); + MemoryUpdateResult updateResult = await projectClient.MemoryStores.UpdateMemoriesAsync(memoryStoreName: memoryStore.Name, options: memoryOptions); + while (updateResult.Status != MemoryStoreUpdateStatus.Failed && updateResult.Status != MemoryStoreUpdateStatus.Completed) + { + await Task.Delay(TimeSpan.FromMilliseconds(500)); + updateResult = await projectClient.MemoryStores.GetUpdateResultAsync(memoryStore.Name, updateResult.UpdateId); + } #endregion #region Snippet:Sample_CheckMemorySearch_Async MemorySearchOptions opts = new(scope) @@ -123,7 +127,7 @@ public async Task MemorySearchToolAsync() [Test] [SyncOnly] - public void MemorySearchTool() + public async Task MemorySearchTool() { IgnoreSampleMayBe(); #if SNIPPET @@ -156,12 +160,12 @@ public void MemorySearchTool() #region Snippet:Sample_WriteOutput_MemoryTool_Sync string scope = "Joke from conversation"; - List updateItems = [request]; + MemoryUpdateOptions memoryOptions = new(scope); + memoryOptions.Items.Add(request); Assert.That(response.Status, Is.EqualTo(ResponseStatus.Completed)); - foreach (ResponseItem item in response.OutputItems) { - updateItems.Add(item); + memoryOptions.Items.Add(item); } Console.WriteLine(response.GetOutputText()); #endregion @@ -175,12 +179,12 @@ public void MemorySearchTool() definition: memoryStoreDefinition, description: "Memory store for conversation." ); - MemoryUpdateOptions updateOptions = new(scope); - foreach (ResponseItem updateItem in updateItems) + MemoryUpdateResult updateResult = projectClient.MemoryStores.UpdateMemories(memoryStoreName: memoryStore.Name, options: memoryOptions); + while (updateResult.Status != MemoryStoreUpdateStatus.Failed && updateResult.Status != MemoryStoreUpdateStatus.Completed) { - updateOptions.Items.Add(updateItem); + Thread.Sleep(TimeSpan.FromMilliseconds(500)); + updateResult = await projectClient.MemoryStores.GetUpdateResultAsync(memoryStore.Name, updateResult.UpdateId); } - projectClient.MemoryStores.UpdateMemories(memoryStoreName: memoryStore.Name, options: updateOptions); #endregion #region Snippet:Sample_CheckMemorySearch_Sync MemorySearchOptions searchOptions = new(scope) diff --git a/sdk/ai/Azure.AI.Projects/CHANGELOG.md b/sdk/ai/Azure.AI.Projects/CHANGELOG.md index 1856b45051d2..228a53f49ab0 100644 --- a/sdk/ai/Azure.AI.Projects/CHANGELOG.md +++ b/sdk/ai/Azure.AI.Projects/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.0.0-beta.3 (2025-11-15) + +### Bugs Fixed + +- Addressed an issue that caused paginated responses like conversation items to never terminate when large numbers of items are fetched + ## 1.2.0-beta.2 (2025-11-14) ### Bugs Fixed diff --git a/sdk/ai/Azure.AI.Projects/assets.json b/sdk/ai/Azure.AI.Projects/assets.json index c8df9096b896..22b57b736da8 100644 --- a/sdk/ai/Azure.AI.Projects/assets.json +++ b/sdk/ai/Azure.AI.Projects/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/ai/Azure.AI.Projects", - "Tag": "net/ai/Azure.AI.Projects_8492e155cb" + "Tag": "net/ai/Azure.AI.Projects_86e6a1c7b5" } diff --git a/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj b/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj index 358fde28da06..3feb7c331767 100644 --- a/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj +++ b/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj @@ -2,7 +2,7 @@ This is the Azure.AI.Projects client library for developing .NET applications with rich experience. Microsoft Azure.AI.Projects client library - 1.2.0-beta.2 + 1.2.0-beta.3 1.1.0 Azure.AI.Projects @@ -48,8 +48,4 @@ - - - - diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/MemoryStores/UpdateMemoryStoreRequest.cs b/sdk/ai/Azure.AI.Projects/src/Custom/MemoryStores/UpdateMemoryStoreRequest.cs new file mode 100644 index 000000000000..acbc6c4a50cd --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Custom/MemoryStores/UpdateMemoryStoreRequest.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects; + +internal partial class UpdateMemoryStoreRequest +{ + /// Initializes a new instance of . + /// A human-readable description of the memory store. + /// Arbitrary key-value metadata to associate with the memory store. + /// Keeps track of any properties unknown to the library. + internal UpdateMemoryStoreRequest(string description, IDictionary metadata, IDictionary additionalBinaryDataProperties) + { + Description = description; + Metadata = metadata ?? new ChangeTrackingDictionary(); + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectConnectionsOperationsGetConnectionsAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectConnectionsOperationsGetConnectionsAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectConnectionsOperationsGetConnectionsAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectConnectionsOperationsGetConnectionsAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectConnectionsOperationsGetConnectionsAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectConnectionsOperationsGetConnectionsAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectConnectionsOperationsGetConnectionsAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectConnectionsOperationsGetConnectionsAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectConnectionsOperationsGetConnectionsCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectConnectionsOperationsGetConnectionsCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectConnectionsOperationsGetConnectionsCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectConnectionsOperationsGetConnectionsCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectConnectionsOperationsGetConnectionsCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectConnectionsOperationsGetConnectionsCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectConnectionsOperationsGetConnectionsCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectConnectionsOperationsGetConnectionsCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetVersionsAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetVersionsAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetVersionsAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetVersionsAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetVersionsAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetVersionsAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetVersionsAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetVersionsAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetVersionsCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetVersionsCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetVersionsCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetVersionsCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetVersionsCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetVersionsCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetVersionsCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetVersionsCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetsAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetsAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetsAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetsAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetsAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetsAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetsAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetsAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetsCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetsCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetsCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetsCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetsCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetsCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDatasetsOperationsGetDatasetsCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDatasetsOperationsGetDatasetsCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDeploymentsOperationsGetDeploymentsAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDeploymentsOperationsGetDeploymentsAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDeploymentsOperationsGetDeploymentsAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDeploymentsOperationsGetDeploymentsAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDeploymentsOperationsGetDeploymentsAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDeploymentsOperationsGetDeploymentsAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDeploymentsOperationsGetDeploymentsAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDeploymentsOperationsGetDeploymentsAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDeploymentsOperationsGetDeploymentsCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDeploymentsOperationsGetDeploymentsCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDeploymentsOperationsGetDeploymentsCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDeploymentsOperationsGetDeploymentsCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDeploymentsOperationsGetDeploymentsCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDeploymentsOperationsGetDeploymentsCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectDeploymentsOperationsGetDeploymentsCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectDeploymentsOperationsGetDeploymentsCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexVersionsAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexVersionsAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexVersionsAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexVersionsAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexVersionsAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexVersionsAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexVersionsAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexVersionsAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexVersionsCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexVersionsCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexVersionsCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexVersionsCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexVersionsCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexVersionsCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexVersionsCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexVersionsCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexesAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexesAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexesAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexesAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexesAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexesAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexesAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexesAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexesCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexesCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexesCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexesCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexesCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexesCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/AIProjectIndexesOperationsGetIndexesCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/AIProjectIndexesOperationsGetIndexesCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationRulesGetAllAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationRulesGetAllAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluationRulesGetAllAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationRulesGetAllAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationRulesGetAllAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationRulesGetAllAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluationRulesGetAllAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationRulesGetAllAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationRulesGetAllCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationRulesGetAllCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluationRulesGetAllCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationRulesGetAllCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationRulesGetAllCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationRulesGetAllCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluationRulesGetAllCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationRulesGetAllCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTaxonomiesGetAllAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationTaxonomiesGetAllAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTaxonomiesGetAllAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationTaxonomiesGetAllAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTaxonomiesGetAllAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationTaxonomiesGetAllAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTaxonomiesGetAllAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationTaxonomiesGetAllAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTaxonomiesGetAllCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationTaxonomiesGetAllCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTaxonomiesGetAllCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationTaxonomiesGetAllCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTaxonomiesGetAllCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationTaxonomiesGetAllCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTaxonomiesGetAllCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluationTaxonomiesGetAllCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetLatestVersionsAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetLatestVersionsAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetLatestVersionsAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetLatestVersionsAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetLatestVersionsAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetLatestVersionsAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetLatestVersionsAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetLatestVersionsAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetLatestVersionsCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetLatestVersionsCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetLatestVersionsCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetLatestVersionsCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetLatestVersionsCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetLatestVersionsCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetLatestVersionsCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetLatestVersionsCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetVersionsAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetVersionsAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetVersionsAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetVersionsAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetVersionsAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetVersionsAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetVersionsAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetVersionsAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetVersionsCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetVersionsCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetVersionsCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetVersionsCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetVersionsCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetVersionsCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/EvaluatorsGetVersionsCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/EvaluatorsGetVersionsCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InsightsGetAllAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/InsightsGetAllAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/InsightsGetAllAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/InsightsGetAllAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InsightsGetAllAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/InsightsGetAllAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/InsightsGetAllAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/InsightsGetAllAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InsightsGetAllCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/InsightsGetAllCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/InsightsGetAllCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/InsightsGetAllCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InsightsGetAllCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/InsightsGetAllCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/InsightsGetAllCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/InsightsGetAllCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RedTeamsGetAllAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/RedTeamsGetAllAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/RedTeamsGetAllAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/RedTeamsGetAllAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RedTeamsGetAllAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/RedTeamsGetAllAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/RedTeamsGetAllAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/RedTeamsGetAllAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RedTeamsGetAllCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/RedTeamsGetAllCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/RedTeamsGetAllCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/RedTeamsGetAllCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RedTeamsGetAllCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/RedTeamsGetAllCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/RedTeamsGetAllCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/RedTeamsGetAllCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetAllAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetAllAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetAllAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetAllAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetAllAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetAllAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetAllAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetAllAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetAllCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetAllCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetAllCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetAllCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetAllCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetAllCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetAllCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetAllCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetRunsAsyncCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetRunsAsyncCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetRunsAsyncCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetRunsAsyncCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetRunsAsyncCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetRunsAsyncCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetRunsAsyncCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetRunsAsyncCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetRunsCollectionResult.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetRunsCollectionResult.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetRunsCollectionResult.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetRunsCollectionResult.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetRunsCollectionResultOfT.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetRunsCollectionResultOfT.cs similarity index 100% rename from sdk/ai/Azure.AI.Projects/src/Generated/SchedulesGetRunsCollectionResultOfT.cs rename to sdk/ai/Azure.AI.Projects/src/Generated/CollectionResults/SchedulesGetRunsCollectionResultOfT.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UpdateMemoryStoreRequest.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UpdateMemoryStoreRequest.Serialization.cs index d212bc017929..00c590ece2ca 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UpdateMemoryStoreRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/UpdateMemoryStoreRequest.Serialization.cs @@ -10,7 +10,6 @@ namespace Azure.AI.Projects { - /// The UpdateMemoryStoreRequest. internal partial class UpdateMemoryStoreRequest : IJsonModel { /// The JSON writer. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UpdateMemoryStoreRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UpdateMemoryStoreRequest.cs index c51471ee0e45..2582837ebe2c 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UpdateMemoryStoreRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/UpdateMemoryStoreRequest.cs @@ -7,7 +7,6 @@ namespace Azure.AI.Projects { - /// The UpdateMemoryStoreRequest. internal partial class UpdateMemoryStoreRequest { /// Keeps track of any properties unknown to the library. @@ -19,17 +18,6 @@ internal UpdateMemoryStoreRequest() Metadata = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . - /// A human-readable description of the memory store. - /// Arbitrary key-value metadata to associate with the memory store. - /// Keeps track of any properties unknown to the library. - internal UpdateMemoryStoreRequest(string description, IDictionary metadata, IDictionary additionalBinaryDataProperties) - { - Description = description; - Metadata = metadata; - _additionalBinaryDataProperties = additionalBinaryDataProperties; - } - /// A human-readable description of the memory store. public string Description { get; } diff --git a/sdk/ai/Azure.AI.Projects/tests/ConnectionsTest.cs b/sdk/ai/Azure.AI.Projects/tests/ConnectionsTest.cs index ccf771103b6f..bb513c65cab1 100644 --- a/sdk/ai/Azure.AI.Projects/tests/ConnectionsTest.cs +++ b/sdk/ai/Azure.AI.Projects/tests/ConnectionsTest.cs @@ -17,7 +17,7 @@ public ConnectionsTest(bool isAsync) : base(isAsync) } [RecordedTest] - [Ignore("Pending 2.* investigation")] + [Ignore("Pending Microsoft.ClientModel.TestFramework migration")] public async Task ConnectionsBasicTest() { var connectionName = TestEnvironment.STORAGECONNECTIONNAME; diff --git a/sdk/ai/Azure.AI.Projects/tests/DeploymentTest.cs b/sdk/ai/Azure.AI.Projects/tests/DeploymentTest.cs index 8fb6953b7907..58b86c3d92ab 100644 --- a/sdk/ai/Azure.AI.Projects/tests/DeploymentTest.cs +++ b/sdk/ai/Azure.AI.Projects/tests/DeploymentTest.cs @@ -22,7 +22,7 @@ public DeploymentTest(bool isAsync) : base(isAsync) //, RecordedTestMode.Record) } [RecordedTest] - [Ignore("Pending 2.* investigation")] + [Ignore("Pending Microsoft.ClientModel.TestFramework migration")] public async Task AIDeploymentTest() { var modelDeploymentName = TestEnvironment.MODELDEPLOYMENTNAME; diff --git a/sdk/ai/Azure.AI.Projects/tests/IndexesTest.cs b/sdk/ai/Azure.AI.Projects/tests/IndexesTest.cs index 3bb1c6c0c2e1..63a81b1bc43b 100644 --- a/sdk/ai/Azure.AI.Projects/tests/IndexesTest.cs +++ b/sdk/ai/Azure.AI.Projects/tests/IndexesTest.cs @@ -21,8 +21,8 @@ public IndexesTest(bool isAsync) : base(isAsync) //, RecordedTestMode.Record) { } - [TestCase] [RecordedTest] + [Ignore("Pending Microsoft.ClientModel.TestFramework migration")] public async Task SearchIndexesTest() { string indexName = TestEnvironment.INDEXNAME; diff --git a/sdk/ai/Azure.AI.Projects/tests/ProjectsClientTestBase.cs b/sdk/ai/Azure.AI.Projects/tests/ProjectsClientTestBase.cs index c8cbf8d5fa8f..bb837db9bf2c 100644 --- a/sdk/ai/Azure.AI.Projects/tests/ProjectsClientTestBase.cs +++ b/sdk/ai/Azure.AI.Projects/tests/ProjectsClientTestBase.cs @@ -23,6 +23,7 @@ namespace Azure.AI.Projects.Tests /// This class now uses a hybrid approach - it extends the standard Azure.Core RecordedTestBase /// but provides manual transport configuration for System.ClientModel compatibility. /// + [Ignore("Pending migration to Microsoft.ClientModel.TestFramework after SCM product migration")] public class ProjectsClientTestBase : RecordedTestBase { #region Debug Method diff --git a/sdk/ai/Azure.AI.Projects/tests/TelemetryTest.cs b/sdk/ai/Azure.AI.Projects/tests/TelemetryTest.cs index a1792ccbdb0d..3c33e506eb9a 100644 --- a/sdk/ai/Azure.AI.Projects/tests/TelemetryTest.cs +++ b/sdk/ai/Azure.AI.Projects/tests/TelemetryTest.cs @@ -21,7 +21,7 @@ public TelemetryTest(bool isAsync) : base(isAsync) //, RecordedTestMode.Record) [TestCase] [RecordedTest] - [Ignore("Pending 2.* investigation")] + [Ignore("Pending Microsoft.ClientModel.TestFramework migration")] public async Task TelemetryOperationsTest() { AIProjectClient projectClient = GetTestClient(); diff --git a/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTests.cs b/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTests.cs index 6e8bb94b468c..6939f2d7ca1b 100644 --- a/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTests.cs +++ b/sdk/ai/Azure.AI.Projects/tests_agents/AgentsTests.cs @@ -13,7 +13,6 @@ using System.Threading.Tasks; using Azure.AI.Projects.OpenAI; using Microsoft.ClientModel.TestFramework; -using Microsoft.Extensions.Options; using NUnit.Framework; using OpenAI; using OpenAI.Files; @@ -74,7 +73,6 @@ public async Task TestAgentCRUD() } [RecordedTest] - // [Ignore("Does not work on service side: see ADO work item 4740406.")] public async Task TestListAgentsAfterAndBefore() { AIProjectClient projectClient = GetTestProjectClient(); @@ -115,7 +113,7 @@ public async Task TestListAgentsAfterAndBefore() } [RecordedTest] - public async Task TestResonses() + public async Task TestResponses() { AIProjectClient projectClient = GetTestProjectClient(); ProjectResponsesClient client = projectClient.OpenAI.GetProjectResponsesClientForModel(TestEnvironment.MODELDEPLOYMENTNAME); @@ -125,7 +123,7 @@ public async Task TestResonses() } [RecordedTest] - public async Task TestResonsesStreaming() + public async Task TestResponsesStreaming() { AIProjectClient projectClient = GetTestProjectClient(); ProjectResponsesClient client = projectClient.OpenAI.GetProjectResponsesClientForModel(TestEnvironment.MODELDEPLOYMENTNAME); @@ -497,14 +495,18 @@ public async Task SimpleWorkflowAgentStreaming() } [RecordedTest] - [Ignore("The working V2 endpoint does not have the embeddings model yet.")] public async Task TestMemoryStoreCRUD() { AIProjectClient projectClient = GetTestProjectClient(); + try + { + var _ = await projectClient.MemoryStores.DeleteMemoryStoreAsync(name: "test-memory-store"); + } + catch { } // Create MemoryStore store = await projectClient.MemoryStores.CreateMemoryStoreAsync("test-memory-store", new MemoryStoreDefaultDefinition(TestEnvironment.MODELDEPLOYMENTNAME, TestEnvironment.EMBEDDINGMODELDEPLOYMENTNAME)); - //Read - MemoryStore result = await projectClient.MemoryStores.GetMemoryStoreAsync(store.Id); + // Read + MemoryStore result = await projectClient.MemoryStores.GetMemoryStoreAsync(store.Name); Assert.That(store.Id, Is.EqualTo(result.Id)); Assert.That(store.Description, Is.EqualTo(result.Description)); Assert.That(store.Name, Is.EqualTo(result.Name)); @@ -517,16 +519,13 @@ public async Task TestMemoryStoreCRUD() ); // Update string newDescription = "Some other description."; - string newName = "New name"; result = await projectClient.MemoryStores.UpdateMemoryStoreAsync( - name: newName, + name: store.Name, description: newDescription ); Assert.That(newDescription, Is.EqualTo(result.Description)); - Assert.That(newName, Is.EqualTo(result.Name)); - result = await projectClient.MemoryStores.GetMemoryStoreAsync(store.Id); + result = await projectClient.MemoryStores.GetMemoryStoreAsync(store.Name); Assert.That(newDescription, Is.EqualTo(result.Description)); - Assert.That(newName, Is.EqualTo(result.Name)); // Delete DeleteMemoryStoreResponse delResult = await projectClient.MemoryStores.DeleteMemoryStoreAsync(name: store.Name); Assert.That(delResult.Deleted, Is.True); @@ -540,16 +539,20 @@ public async Task TestMemoryStoreCRUD() } [RecordedTest] - [Ignore("The working V2 endpoint does not have the embeddings model yet.")] + [Ignore("The service is not ready.")] [TestCase(true)] [TestCase(false)] public async Task TestMemorySearch(bool useConversation) { AIProjectClient projectClient = GetTestProjectClient(); + //try + //{ + // var _ = await projectClient.MemoryStores.DeleteMemoryStoreAsync(name: "test-memory-store"); + //} + //catch { } MemoryStore store = await projectClient.MemoryStores.CreateMemoryStoreAsync("test-memory-store", new MemoryStoreDefaultDefinition(TestEnvironment.MODELDEPLOYMENTNAME, TestEnvironment.EMBEDDINGMODELDEPLOYMENTNAME)); // Create an empty scope and make sure we cannot find anything. string scope = "Test scope"; - await projectClient.MemoryStores.UpdateMemoriesAsync("test-memory-store", new MemoryUpdateOptions(scope)); MemorySearchOptions opts = new(scope) { Items = { ResponseItem.CreateUserMessageItem("Name your favorite animal") }, @@ -562,7 +565,7 @@ public async Task TestMemorySearch(bool useConversation) memoryStoreName: store.Name, options: opts ); - Assert.That(!resp.Memories.Any(), $"Unexpectedly found the result: {resp.Memories[0].MemoryItem.Content}"); + Assert.That(!resp.Memories.Any(), $"Unexpectedly found the result: {(resp.Memories.Any() ? resp.Memories.First().MemoryItem.Content : "")}"); // Populate the scope and make sure, we can get the result. ResponseItem userItem = ResponseItem.CreateUserMessageItem("What is your favorite animal?"); ResponseItem agentItem = ResponseItem.CreateAssistantMessageItem("My favorite animal is Plagiarus praepotens."); @@ -573,6 +576,14 @@ public async Task TestMemorySearch(bool useConversation) { Items = { userItem, agentItem } }); + + while (updateResult.Status != MemoryStoreUpdateStatus.Failed && updateResult.Status != MemoryStoreUpdateStatus.Completed) + { + if (Mode != RecordedTestMode.Playback) + await Task.Delay(TimeSpan.FromMilliseconds(500)); + updateResult = await projectClient.MemoryStores.GetUpdateResultAsync(store.Name, updateResult.UpdateId); + } + Assert.That(updateResult.Status == MemoryStoreUpdateStatus.Completed, $"Unexpected status {updateResult.Status}"); resp = await projectClient.MemoryStores.SearchMemoriesAsync( memoryStoreName: store.Name, options: new MemorySearchOptions(scope)