Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/ai/Azure.AI.Agents.Persistent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Breaking Changes

### Bugs Fixed
- Fix issue with image block serialization in async scenarios [issue](https://github.com/Azure/azure-sdk-for-net/issues/52671)

### Other Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public async Task Setup()
[RecordedTest]
public async Task TestGetResponseAsync()
{
if (!IsAsync)
Assert.Inconclusive(STREAMING_CONSTRAINT);
using IDisposable _ = SetTestSwitch();
PersistentAgentsClient client = GetClient();
PersistentAgentsChatClient chatClient = new(client, _agentId, _threadId);
Expand Down Expand Up @@ -222,6 +224,8 @@ public async Task TestFileSearchToolOutputs()
[RecordedTest]
public async Task TestSubmitToolOutputs()
{
if (!IsAsync)
Assert.Inconclusive(STREAMING_CONSTRAINT);
using IDisposable _ = SetTestSwitch();
PersistentAgentsClient client = GetClient();
FunctionToolDefinition tool = new(
Expand Down Expand Up @@ -281,6 +285,8 @@ public async Task TestSubmitToolOutputs()
[RecordedTest]
public async Task TestChatOptionsTools()
{
if (!IsAsync)
Assert.Inconclusive(STREAMING_CONSTRAINT);
using IDisposable _ = SetTestSwitch();
PersistentAgentsClient client = GetClient();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public partial class PersistentAgentTelemetryTests : RecordedTestBase<AIAgentsTe
{
public const string TraceContentsEnvironmentVariable = "AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED";
public const string EnableOpenTelemetryEnvironmentVariable = "AZURE_EXPERIMENTAL_ENABLE_ACTIVITY_SOURCE";
private const string STREAMING_CONSTRAINT = "The test framework does not support iteration of stream in Sync mode.";
private MemoryTraceExporter _exporter;
private TracerProvider _tracerProvider;
private GenAiTraceVerifier _traceVerifier;
Expand Down Expand Up @@ -859,6 +860,8 @@ public async Task TestAgentChatWithFunctionToolTracingContentRecordingDisabled()
[RecordedTest]
public async Task TestAgentStreamingWithTracingContentRecordingEnabled()
{
if (!IsAsync)
Assert.Inconclusive(STREAMING_CONSTRAINT);
Environment.SetEnvironmentVariable(TraceContentsEnvironmentVariable, "true", EnvironmentVariableTarget.Process);
var type = typeof(Azure.AI.Agents.Persistent.Telemetry.OpenTelemetryScope);
var methodInfo = type.GetMethod("ReinitializeConfiguration", BindingFlags.Static | BindingFlags.NonPublic);
Expand Down Expand Up @@ -933,6 +936,8 @@ public async Task TestAgentStreamingWithTracingContentRecordingEnabled()
[RecordedTest]
public async Task TestAgentStreamingWithTracingContentRecordingDisabled()
{
if (!IsAsync)
Assert.Inconclusive(STREAMING_CONSTRAINT);
Environment.SetEnvironmentVariable(TraceContentsEnvironmentVariable, "false", EnvironmentVariableTarget.Process);
var type = typeof(Azure.AI.Agents.Persistent.Telemetry.OpenTelemetryScope);
var methodInfo = type.GetMethod("ReinitializeConfiguration", BindingFlags.Static | BindingFlags.NonPublic);
Expand Down Expand Up @@ -1006,6 +1011,8 @@ public async Task TestAgentStreamingWithTracingContentRecordingDisabled()
[RecordedTest]
public async Task TestAgentStreamingWithFunctionToolTracingContentRecordingEnabled()
{
if (!IsAsync)
Assert.Inconclusive(STREAMING_CONSTRAINT);
Environment.SetEnvironmentVariable(TraceContentsEnvironmentVariable, "true", EnvironmentVariableTarget.Process);
var type = typeof(Azure.AI.Agents.Persistent.Telemetry.OpenTelemetryScope);
var methodInfo = type.GetMethod("ReinitializeConfiguration", BindingFlags.Static | BindingFlags.NonPublic);
Expand Down Expand Up @@ -1150,6 +1157,8 @@ ToolOutput GetResolvedToolOutput(string functionName, string toolCallId, string
[RecordedTest]
public async Task TestAgentStreamingWithFunctionToolTracingContentRecordingDisabled()
{
if (!IsAsync)
Assert.Inconclusive(STREAMING_CONSTRAINT);
Environment.SetEnvironmentVariable(TraceContentsEnvironmentVariable, "false", EnvironmentVariableTarget.Process);
var type = typeof(Azure.AI.Agents.Persistent.Telemetry.OpenTelemetryScope);
var methodInfo = type.GetMethod("ReinitializeConfiguration", BindingFlags.Static | BindingFlags.NonPublic);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,11 @@ public async Task TestListAgentsAfterAndBefore()
{
for (int i = ids.Count; i < agentLimit; i++)
{
PersistentAgentThread thread = await client.Threads.CreateThreadAsync();
ids.Add((await GetAgent(client)).Id);
PersistentAgent agent = await client.Administration.CreateAgentAsync(
model: "gpt-4o",
name: AGENT_NAME,
instructions: "You are helpful agent.");
ids.Add(agent.Id);
}
}
// Test calling before.
Expand Down Expand Up @@ -2174,6 +2177,8 @@ public async Task TestMcpTool(string trust, bool isPerTool, bool shouldApprove)
[RecordedTest]
public async Task TestMcpToolStreaming()
{
if (!IsAsync && Mode != RecordedTestMode.Live)
Assert.Inconclusive(STREAMING_CONSTRAINT);
PersistentAgentsClient client = GetClient();
MCPToolDefinition mcpTool = new("github", "https://gitmcp.io/Azure/azure-rest-api-specs");
string searchApiCode = "search_azure_rest_api_code";
Expand Down Expand Up @@ -2253,6 +2258,8 @@ public async Task TestMcpToolStreaming()
// AzureAISearch is tested separately in TestAzureAiSearchStreaming.
public async Task TestStreamDelta(ToolTypes toolToTest)
{
if (!IsAsync && Mode != RecordedTestMode.Live)
Assert.Inconclusive(STREAMING_CONSTRAINT);
// Commenting DeepResearch as it is not compatible with unit test framework iterations
// and connection breaks after timeout during streaming test.
// The error says that the thread already contains the active run.
Expand Down