Skip to content

.Net: Python: Introducing Release Candidates of Vector Stores and Collections #11482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6eff772
Python: Multi-agent orchestration: Concurrent + Sequential (#11993)
TaoChenOSU May 13, 2025
37800ff
Python: add explicit typing extensions dep (#12040)
eavanvalkenburg May 13, 2025
bb3c065
.Net Agents - Add support for URL citation on Azure Agent (#11910)
crickman May 13, 2025
ea3215e
Python: Support Declarative Agent Spec for ChatCompletionAgent & Azur…
moonbox3 May 13, 2025
f416032
.Net: Update to latest version of MEAI and move away from deprecated …
eiriktsarpalis May 14, 2025
1e5e892
.Net: Version 1.50.0 (#12063)
markwallace-microsoft May 14, 2025
d826ad8
Python: Multi-agent orchestration: Group Chat (#12045)
TaoChenOSU May 14, 2025
6115e8d
Python: fixes and updates for MCP (#12039)
eavanvalkenburg May 14, 2025
ee96294
Python: Multi-agent orchestration: Handoff (#12046)
TaoChenOSU May 14, 2025
547c631
Python: Bump Python version to 1.30.0 for a release. (#12066)
moonbox3 May 14, 2025
50cf782
Python: Remove Copilot Studio Direct link from Pyproject.toml (#12068)
moonbox3 May 15, 2025
d65f9b2
.Net Obsolete `ITextEmbeddingGenerator` (#11981)
RogerBarreto May 15, 2025
d7c2489
Python: Add MultiAgent Orchestration to README. (#12073)
moonbox3 May 15, 2025
da59f7e
.Net - Agent Orchestration (#11542)
crickman May 15, 2025
fbe0ce7
Python: Place upper-bound on azure-ai-projects until service is ready…
moonbox3 May 16, 2025
7013d5d
.Net: FoundryProcessBuilder for Local Runtime (#12106)
alliscode May 16, 2025
a98580a
.Net: Updated package version (#12108)
dmytrostruk May 16, 2025
a2db35e
add hybrid search
eavanvalkenburg Apr 10, 2025
092f917
fixed other searches
eavanvalkenburg Apr 10, 2025
60fe554
WIP
eavanvalkenburg Apr 15, 2025
8318907
added lambda filters
eavanvalkenburg Apr 15, 2025
45919d6
fixed mypy
eavanvalkenburg Apr 15, 2025
3816381
check result of filter
eavanvalkenburg Apr 15, 2025
3338b97
additional test cases
eavanvalkenburg Apr 16, 2025
f6b3e26
updated filters to optional across the board
eavanvalkenburg Apr 16, 2025
5c82293
add callable to text search options
eavanvalkenburg Apr 16, 2025
d4f23dd
restructured azure ai search and moved to RC
eavanvalkenburg Apr 16, 2025
81c4daf
fixed import
eavanvalkenburg Apr 16, 2025
e93c746
bunch of updates
eavanvalkenburg Apr 17, 2025
e5673eb
fixed tests and mypy
eavanvalkenburg Apr 17, 2025
797f647
add vector store methods for exists and delete
eavanvalkenburg Apr 17, 2025
e58c8ef
update WIP
eavanvalkenburg Apr 29, 2025
51ceb4c
moved old memory stores
eavanvalkenburg Apr 29, 2025
bb786ac
updated ruff
eavanvalkenburg Apr 29, 2025
65c324c
typo
eavanvalkenburg Apr 29, 2025
9c03b4b
WIP
eavanvalkenburg May 1, 2025
f06a176
passed mypy
eavanvalkenburg May 2, 2025
f28f143
fixes
eavanvalkenburg May 2, 2025
b43154a
updated first batch of tests
eavanvalkenburg May 6, 2025
669f405
further tests
eavanvalkenburg May 6, 2025
270c296
typing
eavanvalkenburg May 6, 2025
2ec7fa9
fixed mypy
eavanvalkenburg May 7, 2025
1dbb313
fixed tests
eavanvalkenburg May 7, 2025
e0384e4
class to params
eavanvalkenburg May 8, 2025
440443b
updated chroma
eavanvalkenburg May 8, 2025
1a574fe
google and brave filters
eavanvalkenburg May 9, 2025
b276e1a
updated uv
eavanvalkenburg May 12, 2025
c9145de
redid vector text search
eavanvalkenburg May 12, 2025
79b3c5d
updated hotels sample
eavanvalkenburg May 13, 2025
5da8d05
remove file
eavanvalkenburg May 13, 2025
a657f02
rebuild lock
eavanvalkenburg May 13, 2025
e4ddb19
fixed tests
eavanvalkenburg May 13, 2025
e0c2078
fixed mypy
eavanvalkenburg May 13, 2025
463f902
updated azure ai search sample
eavanvalkenburg May 14, 2025
95ac65d
fixed py3.13 dep import
eavanvalkenburg May 14, 2025
6094b13
added comment
eavanvalkenburg May 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
48 changes: 28 additions & 20 deletions dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
<ItemGroup>
<PackageVersion Include="Aspire.Azure.AI.OpenAI" Version="9.1.0-preview.1.25121.10" />
<PackageVersion Include="Aspire.Azure.Search.Documents" Version="9.2.1" />
<PackageVersion Include="Aspire.Hosting.Azure.Search" Version="9.1.0" />
<PackageVersion Include="Aspire.Hosting.AppHost" Version="9.2.0" />
<PackageVersion Include="Aspire.Hosting.Azure.CognitiveServices" Version="9.1.0" />
<PackageVersion Include="Aspire.Hosting.Azure.Search" Version="9.1.0" />
<PackageVersion Include="AWSSDK.BedrockAgent" Version="4.0.0-preview.13" />
<PackageVersion Include="AWSSDK.BedrockAgentRuntime" Version="4.0.0-preview.13" />
<PackageVersion Include="AWSSDK.BedrockRuntime" Version="4.0.0-preview.13" />
<PackageVersion Include="AWSSDK.Core" Version="4.0.0-preview.13" />
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.0-preview.10" />
<PackageVersion Include="AWSSDK.BedrockRuntime" Version="4.0.0.2" />
<PackageVersion Include="AWSSDK.Core" Version="4.0.0.3" />
<PackageVersion Include="AWSSDK.Extensions.Bedrock.MEAI" Version="4.0.0-preview.16" />
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.0" />
<PackageVersion Include="AWSSDK.SecurityToken" Version="4.0.0.2" />
<PackageVersion Include="Azure.AI.ContentSafety" Version="1.0.0" />
<PackageVersion Include="Azure.AI.Inference" Version="1.0.0-beta.2" />
<PackageVersion Include="Azure.AI.OpenAI" Version="[2.2.0-beta.4]" />
Expand All @@ -29,28 +31,30 @@
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="FastBertTokenizer" Version="1.0.28" />
<PackageVersion Include="Google.Apis.Auth" Version="1.69.0" />
<PackageVersion Include="Google.Apis.CustomSearchAPI.v1" Version="1.68.0.3520" />
<PackageVersion Include="Google.Protobuf" Version="3.27.1" />
<PackageVersion Include="Grpc.AspNetCore" Version="2.70.0" />
<PackageVersion Include="Grpc.AspNetCore.Server" Version="2.70.0" />
<PackageVersion Include="Grpc.AspNetCore.Server.Reflection" Version="2.70.0" />
<PackageVersion Include="Grpc.AspNetCore.Web" Version="2.70.0" />
<PackageVersion Include="Grpc.Net.Client" Version="2.70.0" />
<PackageVersion Include="Grpc.Tools" Version="2.71.0" />
<PackageVersion Include="ModelContextProtocol" Version="0.1.0-preview.13" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.13" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.14" />
<PackageVersion Include="Microsoft.ML.Tokenizers.Data.Cl100kBase" Version="1.0.1" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.5.1" />
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.12.19" />
<PackageVersion Include="JmesPath.Net" Version="1.0.330" />
<PackageVersion Include="JsonSchema.Net.Generation" Version="5.0.2" />
<PackageVersion Include="Handlebars.Net.Helpers" Version="2.4.10" />
<PackageVersion Include="Handlebars.Net" Version="2.1.6" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.72" />
<PackageVersion Include="JsonSchema.Net" Version="5.4.2" />
<PackageVersion Include="JsonSchema.Net" Version="7.3.4" />
<PackageVersion Include="Markdig" Version="0.40.0" />
<PackageVersion Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.13" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.14" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker" Version="2.0.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.3.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.0.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues" Version="5.5.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore"
Version="2.0.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues"
Version="5.5.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.SDK" Version="2.0.0" />
<PackageVersion Include="Microsoft.Azure.Kusto.Data" Version="12.2.8" />
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions.OpenApi" Version="1.5.1" />
Expand All @@ -62,7 +66,11 @@
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" />
<PackageVersion Include="Microsoft.Bcl.TimeProvider" Version="8.0.1" />
<PackageVersion Include="Microsoft.Identity.Client" Version="4.67.2" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.5.1" />
<PackageVersion Include="Microsoft.ML.OnnxRuntime" Version="1.21.0" />
<PackageVersion Include="Microsoft.ML.Tokenizers.Data.Cl100kBase" Version="1.0.1" />
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.12.19" />
<PackageVersion Include="ModelContextProtocol" Version="0.1.0-preview.13" />
<PackageVersion Include="MSTest.TestFramework" Version="3.8.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Npgsql" Version="8.0.6" />
Expand Down Expand Up @@ -94,14 +102,16 @@
<PackageVersion Include="Microsoft.DeepDev.TokenizerLib" Version="1.3.3" />
<PackageVersion Include="SharpToken" Version="2.0.3" />
<!-- Microsoft.Extensions.* -->
<PackageVersion Include="Microsoft.Extensions.AI" Version="9.4.4-preview.1.25259.16" />
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="9.4.4-preview.1.25259.16" />
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="9.4.4-preview.1.25259.16" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="9.4.4-preview.1.25259.16" />
<PackageVersion Include="Microsoft.Extensions.AI" Version="9.5.0-preview.1.25262.9" />
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="9.5.0-preview.1.25262.9" />
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference"
Version="9.5.0-preview.1.25262.9" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="9.5.0-preview.1.25262.9" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables"
Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
Expand Down Expand Up @@ -145,8 +155,6 @@
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="1.6.23" />
<PackageVersion Include="Microsoft.OpenApi.ApiManifest" Version="0.5.6-preview" />
<PackageVersion Include="Microsoft.Plugins.Manifest" Version="1.0.0-rc3" />
<PackageVersion Include="Google.Apis.CustomSearchAPI.v1" Version="1.68.0.3520" />
<PackageVersion Include="Grpc.Net.Client" Version="2.70.0" />
<PackageVersion Include="protobuf-net" Version="3.2.45" />
<PackageVersion Include="protobuf-net.Reflection" Version="3.2.12" />
<PackageVersion Include="YamlDotNet" Version="15.3.0" />
Expand Down
11 changes: 10 additions & 1 deletion dotnet/SK-dotnet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Runtime.InProcess.UnitTests
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VectorData.UnitTests", "src\Connectors\VectorData.UnitTests\VectorData.UnitTests.csproj", "{AAC7B5E8-CC4E-49D0-AF6A-2B4F7B43BD84}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Agents.Orchestration", "src\Agents\Orchestration\Agents.Orchestration.csproj", "{D1A02387-FA60-22F8-C2ED-4676568B6CC3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1511,6 +1513,12 @@ Global
{AAC7B5E8-CC4E-49D0-AF6A-2B4F7B43BD84}.Publish|Any CPU.Build.0 = Debug|Any CPU
{AAC7B5E8-CC4E-49D0-AF6A-2B4F7B43BD84}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AAC7B5E8-CC4E-49D0-AF6A-2B4F7B43BD84}.Release|Any CPU.Build.0 = Release|Any CPU
{D1A02387-FA60-22F8-C2ED-4676568B6CC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1A02387-FA60-22F8-C2ED-4676568B6CC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1A02387-FA60-22F8-C2ED-4676568B6CC3}.Publish|Any CPU.ActiveCfg = Publish|Any CPU
{D1A02387-FA60-22F8-C2ED-4676568B6CC3}.Publish|Any CPU.Build.0 = Publish|Any CPU
{D1A02387-FA60-22F8-C2ED-4676568B6CC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1A02387-FA60-22F8-C2ED-4676568B6CC3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -1536,7 +1544,7 @@ Global
{AFA81EB7-F869-467D-8A90-744305D80AAC} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
{627742DB-1E52-468A-99BD-6FF1A542D25B} = {831DDCA2-7D2C-4C31-80DB-6BDB3E1F7AE0}
{E3299033-EB81-4C4C-BCD9-E8DC40937969} = {831DDCA2-7D2C-4C31-80DB-6BDB3E1F7AE0}
{078F96B4-09E1-4E0E-B214-F71A4F4BF633} = {831DDCA2-7D2C-4C31-80DB-6BDB3E1F7AE0}
{078F96B4-09E1-4E0E-B214-F71A4F4BF633} = {9ECD1AA0-75B3-4E25-B0B5-9F0945B64974}
{F51017A9-15C8-472D-893C-080046D710A6} = {078F96B4-09E1-4E0E-B214-F71A4F4BF633}
{EC3BB6D1-2FB2-4702-84C6-F791DE533ED4} = {24503383-A8C4-4255-9998-28D70FE8E99A}
{4D226C2F-AE9F-4EFB-AF2D-45C8FE5CB34E} = {24503383-A8C4-4255-9998-28D70FE8E99A}
Expand Down Expand Up @@ -1716,6 +1724,7 @@ Global
{CCC909E4-5269-A31E-0BFD-4863B4B29BBB} = {A70ED5A7-F8E1-4A57-9455-3C05989542DA}
{DA6B4ED4-ED0B-D25C-889C-9F940E714891} = {A70ED5A7-F8E1-4A57-9455-3C05989542DA}
{AAC7B5E8-CC4E-49D0-AF6A-2B4F7B43BD84} = {5A7028A7-4DDF-4E4F-84A9-37CE8F8D7E89}
{D1A02387-FA60-22F8-C2ED-4676568B6CC3} = {6823CD5E-2ABE-41EB-B865-F86EC13F0CF9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FBDC56A3-86AD-4323-AA0F-201E59123B83}
Expand Down
1 change: 1 addition & 0 deletions dotnet/docs/EXPERIMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ You can use the following diagnostic IDs to ignore warnings or errors for a part
| SKEXP0070 | Amazon AI connector | | | | | |
| | | | | | | |
| SKEXP0080 | Process Framework |
| SKEXP0081 | Process Framework - Foundry Process
| | | | | | | |
| SKEXP0101 | Experiment with Assistants |
| SKEXP0101 | Experiment with Flow Orchestration |
Expand Down
26 changes: 8 additions & 18 deletions dotnet/format.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ pushd $repoRoot
$targets =
git diff --name-only main..HEAD |
ForEach-Object {
Write-Host "$_ was changed"

$dir = Split-Path (Join-Path $repoRoot $_) -Parent # << absolute
while ($dir -and $dir -ne $repoRoot) {
$proj = Get-ChildItem -LiteralPath $dir -Filter *.csproj -File -ErrorAction Ignore |
Select-Object -First 1

if ($proj) {
if ($exclude -notcontains $proj.Name) { $proj.FullName }
break
Expand All @@ -29,27 +28,18 @@ $targets =
} |
Sort-Object -Unique

popd

if (-not $targets) {
# $targets = Get-ChildItem $repoRoot -Recurse -Filter *.sln |
# Select-Object -Expand FullName
Write-Host "No code changes found"
}

if ($PSVersionTable.PSVersion.Major -ge 7) {
$targets | ForEach-Object -Parallel {
param($t) ; Write-Host " $t" ; dotnet format --verbosity normal $t
}
} else {
$jobs = foreach ($t in $targets) {
Start-Job -ScriptBlock {
param($target)
Write-Host " $target"
dotnet format --verbosity normal $target
} -ArgumentList $t
}

# wait for all to finish and surface errors
$jobs | Receive-Job -Wait -AutoRemoveJob
foreach ($t in $targets) {
Write-Host "Formatting $t"
}

popd
foreach ($t in $targets) {
dotnet format --no-restore --verbosity diag $t
}
6 changes: 3 additions & 3 deletions dotnet/nuget.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>

<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
Expand All @@ -11,5 +11,5 @@
<package pattern="*" />
</packageSource>
</packageSourceMapping>

</configuration>
4 changes: 2 additions & 2 deletions dotnet/nuget/nuget-package.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project>
<PropertyGroup>
<!-- Central version prefix - applies to all nuget packages. -->
<VersionPrefix>1.49.0</VersionPrefix>
<VersionPrefix>1.51.0</VersionPrefix>
<PackageVersion Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix)</PackageVersion>
<PackageVersion Condition="'$(VersionSuffix)' == ''">$(VersionPrefix)</PackageVersion>

<Configurations>Debug;Release;Publish</Configurations>
<IsPackable>true</IsPackable>

<!-- Package validation. Baseline Version should be the latest version available on NuGet. -->
<PackageValidationBaselineVersion>1.48.0</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>1.50.0</PackageValidationBaselineVersion>
<!-- Validate assembly attributes only for Publish builds -->
<NoWarn Condition="'$(Configuration)' != 'Publish'">$(NoWarn);CP0003</NoWarn>
<!-- Do not validate reference assemblies -->
Expand Down
22 changes: 11 additions & 11 deletions dotnet/samples/Concepts/Caching/SemanticCachingWithFilters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

using System.Diagnostics;
using Azure.Identity;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.VectorData;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Embeddings;

namespace Caching;

Expand Down Expand Up @@ -124,8 +124,8 @@ private Kernel GetKernelWithCache(Action<IServiceCollection> configureVectorStor
TestConfiguration.AzureOpenAI.Endpoint,
TestConfiguration.AzureOpenAI.ApiKey);

// Add Azure OpenAI text embedding generation service
builder.AddAzureOpenAITextEmbeddingGeneration(
// Add Azure OpenAI embedding generator
builder.AddAzureOpenAIEmbeddingGenerator(
TestConfiguration.AzureOpenAIEmbeddings.DeploymentName,
TestConfiguration.AzureOpenAIEmbeddings.Endpoint,
TestConfiguration.AzureOpenAI.ApiKey);
Expand All @@ -138,8 +138,8 @@ private Kernel GetKernelWithCache(Action<IServiceCollection> configureVectorStor
TestConfiguration.AzureOpenAI.Endpoint,
new AzureCliCredential());

// Add Azure OpenAI text embedding generation service
builder.AddAzureOpenAITextEmbeddingGeneration(
// Add Azure OpenAI embedding generator
builder.AddAzureOpenAIEmbeddingGenerator(
TestConfiguration.AzureOpenAIEmbeddings.DeploymentName,
TestConfiguration.AzureOpenAIEmbeddings.Endpoint,
new AzureCliCredential());
Expand Down Expand Up @@ -181,7 +181,7 @@ public class CacheBaseFilter
/// Filter which is executed during prompt rendering operation.
/// </summary>
public sealed class PromptCacheFilter(
ITextEmbeddingGenerationService textEmbeddingGenerationService,
IEmbeddingGenerator<string, Embedding<float>> embeddingGenerator,
IVectorStore vectorStore)
: CacheBaseFilter, IPromptRenderFilter
{
Expand All @@ -193,7 +193,7 @@ public async Task OnPromptRenderAsync(PromptRenderContext context, Func<PromptRe
// Get rendered prompt
var prompt = context.RenderedPrompt!;

var promptEmbedding = await textEmbeddingGenerationService.GenerateEmbeddingAsync(prompt);
var promptEmbedding = await embeddingGenerator.GenerateAsync(prompt);

var collection = vectorStore.GetCollection<string, CacheRecord>(CollectionName);
await collection.CreateCollectionIfNotExistsAsync();
Expand All @@ -218,11 +218,11 @@ public async Task OnPromptRenderAsync(PromptRenderContext context, Func<PromptRe
/// Filter which is executed during function invocation.
/// </summary>
public sealed class FunctionCacheFilter(
ITextEmbeddingGenerationService textEmbeddingGenerationService,
IEmbeddingGenerator<string, Embedding<float>> embeddingGenerator,
IVectorStore vectorStore)
: CacheBaseFilter, IFunctionInvocationFilter
{
public async Task OnFunctionInvocationAsync(FunctionInvocationContext context, Func<FunctionInvocationContext, Task> next)
public async Task OnFunctionInvocationAsync(Microsoft.SemanticKernel.FunctionInvocationContext context, Func<Microsoft.SemanticKernel.FunctionInvocationContext, Task> next)
{
// Trigger function invocation
await next(context);
Expand All @@ -237,7 +237,7 @@ public async Task OnFunctionInvocationAsync(FunctionInvocationContext context, F
var recordId = context.Result.Metadata?.GetValueOrDefault(RecordIdKey, Guid.NewGuid().ToString()) as string;

// Generate prompt embedding.
var promptEmbedding = await textEmbeddingGenerationService.GenerateEmbeddingAsync(context.Result.RenderedPrompt);
var promptEmbedding = await embeddingGenerator.GenerateAsync(context.Result.RenderedPrompt);

// Cache rendered prompt and LLM result.
var collection = vectorStore.GetCollection<string, CacheRecord>(CollectionName);
Expand All @@ -248,7 +248,7 @@ public async Task OnFunctionInvocationAsync(FunctionInvocationContext context, F
Id = recordId!,
Prompt = context.Result.RenderedPrompt,
Result = result.ToString(),
PromptEmbedding = promptEmbedding
PromptEmbedding = promptEmbedding.Vector
};

await collection.UpsertAsync(cacheRecord, cancellationToken: context.CancellationToken);
Expand Down
Loading
Loading