Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Data;
Comment thread
SergeyMenshykh marked this conversation as resolved.
using Microsoft.Agents.AI.Samples;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.VectorData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Data;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.VectorData;
using Microsoft.SemanticKernel.Connectors.Qdrant;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Data;
using Microsoft.Extensions.AI;
using OpenAI;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Data;
Comment thread
SergeyMenshykh marked this conversation as resolved.
using Microsoft.Extensions.AI;
using OpenAI;

var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set.");
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o-mini";

TextSearchProviderOptions textSearchOptions = new()

Check failure on line 17 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net472, windows-latest, Release, true, integration)

The type or namespace name 'TextSearchProviderOptions' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 17 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net472, windows-latest, Release, true, integration)

The type or namespace name 'TextSearchProviderOptions' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 17 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net8.0, ubuntu-latest, Release)

The type or namespace name 'TextSearchProviderOptions' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 17 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net8.0, ubuntu-latest, Release)

The type or namespace name 'TextSearchProviderOptions' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 17 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net10.0, ubuntu-latest, Release, true, integration)

The type or namespace name 'TextSearchProviderOptions' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 17 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net10.0, ubuntu-latest, Release, true, integration)

The type or namespace name 'TextSearchProviderOptions' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 17 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net9.0, windows-latest, Debug)

The type or namespace name 'TextSearchProviderOptions' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 17 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net9.0, windows-latest, Debug)

The type or namespace name 'TextSearchProviderOptions' could not be found (are you missing a using directive or an assembly reference?)
{
// Run the search prior to every model invocation and keep a short rolling window of conversation context.
SearchTime = TextSearchProviderOptions.TextSearchBehavior.BeforeAIInvoke,

Check failure on line 20 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net472, windows-latest, Release, true, integration)

The name 'TextSearchProviderOptions' does not exist in the current context

Check failure on line 20 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net472, windows-latest, Release, true, integration)

The name 'TextSearchProviderOptions' does not exist in the current context

Check failure on line 20 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net8.0, ubuntu-latest, Release)

The name 'TextSearchProviderOptions' does not exist in the current context

Check failure on line 20 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net8.0, ubuntu-latest, Release)

The name 'TextSearchProviderOptions' does not exist in the current context

Check failure on line 20 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net10.0, ubuntu-latest, Release, true, integration)

The name 'TextSearchProviderOptions' does not exist in the current context

Check failure on line 20 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net10.0, ubuntu-latest, Release, true, integration)

The name 'TextSearchProviderOptions' does not exist in the current context

Check failure on line 20 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net9.0, windows-latest, Debug)

The name 'TextSearchProviderOptions' does not exist in the current context

Check failure on line 20 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net9.0, windows-latest, Debug)

The name 'TextSearchProviderOptions' does not exist in the current context
RecentMessageMemoryLimit = 6,
};

Expand All @@ -29,16 +28,16 @@
.CreateAIAgent(new ChatClientAgentOptions
{
Instructions = "You are a helpful support specialist for Contoso Outdoors. Answer questions using the provided context and cite the source document when available.",
AIContextProviderFactory = ctx => new TextSearchProvider(MockSearchAsync, ctx.SerializedState, ctx.JsonSerializerOptions, textSearchOptions)

Check failure on line 31 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net472, windows-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 31 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net472, windows-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 31 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net8.0, ubuntu-latest, Release)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 31 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net8.0, ubuntu-latest, Release)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 31 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net10.0, ubuntu-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 31 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net10.0, ubuntu-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 31 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net9.0, windows-latest, Debug)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 31 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net9.0, windows-latest, Debug)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)
});

await agent.RunAIAgentAsync();

static Task<IEnumerable<TextSearchProvider.TextSearchResult>> MockSearchAsync(string query, CancellationToken cancellationToken)

Check failure on line 36 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net472, windows-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 36 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net8.0, ubuntu-latest, Release)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 36 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net10.0, ubuntu-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 36 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net9.0, windows-latest, Debug)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)
{
// The mock search inspects the user's question and returns pre-defined snippets
// that resemble documents stored in an external knowledge source.
List<TextSearchProvider.TextSearchResult> results = [];

Check failure on line 40 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net472, windows-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 40 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net472, windows-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 40 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net8.0, ubuntu-latest, Release)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 40 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net8.0, ubuntu-latest, Release)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 40 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net10.0, ubuntu-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 40 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net10.0, ubuntu-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 40 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net9.0, windows-latest, Debug)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 40 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net9.0, windows-latest, Debug)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

if (query.Contains("return", StringComparison.OrdinalIgnoreCase) || query.Contains("refund", StringComparison.OrdinalIgnoreCase))
{
Expand Down Expand Up @@ -70,5 +69,5 @@
});
}

return Task.FromResult<IEnumerable<TextSearchProvider.TextSearchResult>>(results);

Check failure on line 72 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net472, windows-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 72 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net8.0, ubuntu-latest, Release)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 72 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net10.0, ubuntu-latest, Release, true, integration)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 72 in dotnet/samples/HostedAgents/AgentWithTextSearchRag/Program.cs

View workflow job for this annotation

GitHub Actions / dotnet-build-and-test (net9.0, windows-latest, Debug)

The type or namespace name 'TextSearchProvider' could not be found (are you missing a using directive or an assembly reference?)
}
1 change: 0 additions & 1 deletion dotnet/src/Microsoft.Agents.AI/AgentJsonUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.Agents.AI.Data;

namespace Microsoft.Agents.AI;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Microsoft.Extensions.Logging;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.Agents.AI.Data;
namespace Microsoft.Agents.AI;

/// <summary>
/// A text search context provider that performs a search over external knowledge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Collections.Generic;
using Microsoft.Extensions.AI;

namespace Microsoft.Agents.AI.Data;
namespace Microsoft.Agents.AI;

/// <summary>
/// Options controlling the behavior of <see cref="TextSearchProvider"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Agents.AI.Data;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.Logging;
using Moq;
Expand Down
Loading