Skip to content

Commit 988e9ee

Browse files
jeffhandleystephentoubeiriktsarpalisjozkeegewarren
authored
[9.5] Merge from main into release/9.5 for MEAI stable package releases (#6451)
* Translate OpenAI refusals to ErrorContent (#6393) Refusals in OpenAI are errors reported when the service can't generate an output that matches the requested schema. Translate refusals to ErrorContent now that we have it. * Add JSON schema transformation functionality to `AIJsonUtilities` (#6383) * Add initial schema transformation functionality and incorporate into the OpenAI leaf client. * Update all leaf client implementions, improve naming, add testing. * Remove redundant suppressions * Address feedback. * Add ChatOptions.RawRepresentationFactory (#6319) * Look for OpenAI.ChatCompletionOptions in top-level additional properties and stop looking for individually specific additional properties * Add RawRepresentation to ChatOptions and use it in OpenAI and AzureAIInference * Remove now unused locals * Add [JsonIgnore] and update roundtrip tests * Overwirte properties only if the underlying model don't specify it already * Clone RawRepresentation * Reflection workaround for ToolChoice not being cloned * Style changes * AI.Inference: Bring back propagation of additional properties * Don't use 0.1f, it doesn't roundtrip properly in .NET Framework * Add RawRepresentationFactory instead of object? property * Augment remarks to discourage returning shared instances * Documentation feedback * AI.Inference: keep passing TopK as AdditionalProperty if not already there * Fix streaming chat response example (#6408) * Move AIFunctionFactory down to M.E.AI.Abstractions (#6412) * Remove AIFunctionFactory dependency on M.E.DI This means reverting the recent changes to it that: - Special-cased KeyedServices - Special-cased IServiceProviderIsService - Used ActivatorUtilities.CreateInstance * Move AIFunctionFactory down to M.E.AI.Abstractions * Add CreateInstance delegate to AIFunctionFactoryOptions To enable use of ActivatorUtilities.CreateInstance or alternative. * Add some comments * Fix handling of tool calls with some OpenAI endpoints (#6405) * Fix handling of tool calls with some endpoints Most assistant messages containing tool calls don't contain text as well (though some can). In such a case, we were still creating the assistant with empty text. While OpenAI's service permits that, some other endpoints are more finicky about it. This avoids doing so. * Reduce to single iteration through assistant content * Delete Microsoft.Extensions.AI.Abstractions APIs marked [Obsolete] during preview (#6414) * Add WriteAsync overrides to stream helper in AIFunctionFactory (#6419) We use JsonSerializer.SerializeAsync but were missing the async overrides. As with MemoryStream, these don't need to queue. * Replace Type targetType AIFunctionFactory.Create parameter with a func (#6424) * Add an AIJsonSchemaTransformOptions property inside AIJsonSchemaCreateOptions and mark redundant properties in the latter as obsolete. (#6427) * Add an AIJsonSchemaTransformOptions property inside AIJsonSchemaCreateOptions and mark redundant properties in the latter as obsolete. * s/inferred/created * Eliminate ingestion cache from AI Chat Web template (#6428) * Begin updating to latest MEVD * Reimplement JsonVectorStore to match updated MEVD APIs * Remove ingestion cache and track ingestion status inside the vector DB * Track the document metadata in a separate collection so we don't have to fetch literally everything from the vector DB in order to update ingestion * Fix equality comparison issue with Qdrant connector * Tidying * More tidying * Update MEAI.Templates test snapshots --------- Co-authored-by: Jeff Handley <[email protected]> * Update the template test README with snapshot update instructions (#6431) * AI Chat Web template fixes for Azure AI Search (#6429) * AI Chat Web template fixes for Azure AI Search * Update snapshots * Add security comments for chat clients (#6386) * Remove unused select param (#6341) CreateRecordsForDocumentAsync includes `Select((pair, index) =>` but index is never used Co-authored-by: Jeff Handley <[email protected]> * Add RawRepresentationFactory to other options types (#6433) * Add RawRepresentationFactory to other options types * Undo changes in Azure.AI.Inference * Address documentation feedback * Ensure the type keyword is included when generating schemas for nullable enums. (#6440) * Remove obsolete members from AIJsonSchemaCreateOptions (#6432) * Use RawRepresentationFactory on AzureAIInference embedding generators (#6445) * Mark Microsoft.Extensions.AI and Microsoft.Extensions.AI.Abstractions as stable (#6446) * Bump ICSharpCode.Decompiler for record struct support in ApiChief tool Needed the fix for icsharpcode/ILSpy#3159 to fix "record struct" formatting (it was "recordstruct" before the fix). * Generate ApiChief baselines for MEAI libraries Ran .\scripts\MakeApiBaselines.ps1 and discarded other libraries' updates. * Hand-edit MEAI ApiChief baseline to fix params ReadOnlySpan Params collections are not yet supported in ICSharpCode.Decompiler: icsharpcode/ILSpy#829 The result is an emitted 'scoped' keyword instead of 'params'. This was edited by hand in the baseline MEAI file. * Mark Microsoft.Extensions.AI and Microsoft.Extensions.AI.Abstractions as stable * Update MEAI and MEAI.Abstractions NuGet package documentation * Update NuGet package documentation for MEAI implementation packages * Update MEAI.Templates package references, including SemanticKernel for a coherent build. * Lower OllamaSharp for integration tests to use version available on feed * Empty the ApiChief baselines for Ollama, AzureAIInference, and OpenAI adapters since they are not shipping stable * Apply code review feedback to the MEAI package READMEs * Update MEAI.Templates test snapshots for version bumps * Apply documentation review feedback to the MEAI package READMEs * Add comments to the MEAI API baseline file for the hand-editing required * Restore documentation blurb into Microsoft.Extensions.AI.AzureAIInference per other feedback * Use stable version for MEAI in templates * Mark Microsoft.Extensions.AI.Evaluation.* Libraries as stable (#6450) * Mark Microsoft.Extensions.AI packages stable All packages except Microsoft.Extensions.AI.Evaluation.Safety are being marked stable. * Remove primary constructors from API json files. * Remove more primary constructors from API Chief json --------- Co-authored-by: Jeff Handley <[email protected]> --------- Co-authored-by: Stephen Toub <[email protected]> Co-authored-by: Eirik Tsarpalis <[email protected]> Co-authored-by: David Cantú <[email protected]> Co-authored-by: Genevieve Warren <[email protected]> Co-authored-by: Steve Sanderson <[email protected]> Co-authored-by: Mackinnon Buck <[email protected]> Co-authored-by: Jon Galloway <[email protected]> Co-authored-by: Peter Waldschmidt <[email protected]>
1 parent 009457a commit 988e9ee

File tree

97 files changed

+5621
-1875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+5621
-1875
lines changed

eng/Versions.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,19 @@
160160
<AspireAzureAIOpenAIVersion>9.2.1-preview.1.25222.1</AspireAzureAIOpenAIVersion>
161161
<AzureAIProjectsVersion>1.0.0-beta.6</AzureAIProjectsVersion>
162162
<AzureAIOpenAIVersion>2.2.0-beta.4</AzureAIOpenAIVersion>
163-
<AzureIdentityVersion>1.13.2</AzureIdentityVersion>
163+
<AzureIdentityVersion>1.14.0</AzureIdentityVersion>
164164
<AzureSearchDocumentsVersion>11.6.0</AzureSearchDocumentsVersion>
165165
<CommunityToolkitAspireHostingOllamaVersion>9.4.1-beta.277</CommunityToolkitAspireHostingOllamaVersion>
166166
<CommunityToolkitAspireHostingSqliteVersion>9.4.1-beta.277</CommunityToolkitAspireHostingSqliteVersion>
167167
<CommunityToolkitAspireMicrosoftEntityFrameworkCoreSqliteVersion>9.4.1-beta.277</CommunityToolkitAspireMicrosoftEntityFrameworkCoreSqliteVersion>
168168
<CommunityToolkitAspireOllamaSharpVersion>9.4.1-beta.277</CommunityToolkitAspireOllamaSharpVersion>
169169
<MicrosoftExtensionsServiceDiscoveryVersion>9.2.0</MicrosoftExtensionsServiceDiscoveryVersion>
170-
<MicrosoftSemanticKernelConnectorsAzureAISearchVersion>1.47.0-preview</MicrosoftSemanticKernelConnectorsAzureAISearchVersion>
171-
<MicrosoftSemanticKernelConnectorsQdrantVersion>1.47.0-preview</MicrosoftSemanticKernelConnectorsQdrantVersion>
172-
<MicrosoftSemanticKernelCoreVersion>1.47.0</MicrosoftSemanticKernelCoreVersion>
173-
<OllamaSharpVersion>5.1.13</OllamaSharpVersion>
170+
<MicrosoftSemanticKernelConnectorsAzureAISearchVersion>1.50.0-preview</MicrosoftSemanticKernelConnectorsAzureAISearchVersion>
171+
<MicrosoftSemanticKernelConnectorsQdrantVersion>1.50.0-preview</MicrosoftSemanticKernelConnectorsQdrantVersion>
172+
<MicrosoftSemanticKernelCoreVersion>1.50.0</MicrosoftSemanticKernelCoreVersion>
173+
<OllamaSharpVersion>5.1.16</OllamaSharpVersion>
174174
<OpenTelemetryVersion>1.9.0</OpenTelemetryVersion>
175-
<PdfPigVersion>0.1.9</PdfPigVersion>
175+
<PdfPigVersion>0.1.10</PdfPigVersion>
176176
<SystemLinqAsyncVersion>6.0.1</SystemLinqAsyncVersion>
177177
<!--
178178
xUnit version is configured by the Arcade SDK.

eng/packages/General.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<PackageVersion Include="Azure.Identity" Version="1.13.2" />
66
<PackageVersion Include="Azure.Storage.Files.DataLake" Version="12.21.0" />
77
<PackageVersion Include="Azure.AI.Inference" Version="1.0.0-beta.4" />
8-
<PackageVersion Include="ICSharpCode.Decompiler" Version="8.2.0.7535" />
8+
<PackageVersion Include="ICSharpCode.Decompiler" Version="9.1.0.7988" />
99
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
1010
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="$(MicrosoftCodeAnalysisAnalyzersVersion)" />
1111
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="$(MicrosoftCodeAnalysisVersion)" />

eng/packages/TestOnly.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PackageVersion Include="Moq.AutoMock" Version="3.1.0" />
1919
<PackageVersion Include="Moq" Version="4.18.4" />
2020
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="1.9.0" />
21-
<PackageVersion Include="PdfPig" Version="0.1.10-alpha-20250203-fdb88" />
21+
<PackageVersion Include="PdfPig" Version="0.1.10" />
2222
<PackageVersion Include="Polly.Testing" Version="8.4.2" />
2323
<PackageVersion Include="StrongNamer" Version="0.2.5" />
2424
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerVersion)" />

src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatOptions.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@ namespace Microsoft.Extensions.AI;
1111
/// <related type="Article" href="https://learn.microsoft.com/dotnet/ai/microsoft-extensions-ai#provide-options">Provide options.</related>
1212
public class ChatOptions
1313
{
14-
/// <summary>Gets or sets an optional identifier used to associate a request with an existing conversation.</summary>
15-
/// <remarks>This property is obsolete. Use <see cref="ConversationId"/> instead.</remarks>
16-
[System.Obsolete("Use ConversationId instead.")]
17-
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
18-
public string? ChatThreadId
19-
{
20-
get => ConversationId;
21-
set => ConversationId = value;
22-
}
23-
2414
/// <summary>Gets or sets an optional identifier used to associate a request with an existing conversation.</summary>
2515
/// <related type="Article" href="https://learn.microsoft.com/dotnet/ai/microsoft-extensions-ai#stateless-vs-stateful-clients">Stateless vs. stateful clients.</related>
2616
public string? ConversationId { get; set; }
@@ -123,7 +113,7 @@ public string? ChatThreadId
123113
public IList<AITool>? Tools { get; set; }
124114

125115
/// <summary>
126-
/// Gets or sets a callback responsible of creating the raw representation of the chat options from an underlying implementation.
116+
/// Gets or sets a callback responsible for creating the raw representation of the chat options from an underlying implementation.
127117
/// </summary>
128118
/// <remarks>
129119
/// The underlying <see cref="IChatClient" /> implementation may have its own representation of options.
@@ -134,8 +124,8 @@ public string? ChatThreadId
134124
/// implementation-specific options type may be returned by this callback, for the <see cref="IChatClient" />
135125
/// implementation to use instead of creating a new instance. Such implementations may mutate the supplied options
136126
/// instance further based on other settings supplied on this <see cref="ChatOptions" /> instance or from other inputs,
137-
/// like the enumerable of <see cref="ChatMessage"/>s, therefore, its **strongly recommended** to not return shared instances
138-
/// and instead make the callback return a new instance per each call.
127+
/// like the enumerable of <see cref="ChatMessage"/>s, therefore, it is <b>strongly recommended</b> to not return shared instances
128+
/// and instead make the callback return a new instance on each call.
139129
/// This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly-typed
140130
/// properties on <see cref="ChatOptions" />.
141131
/// </remarks>

src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatResponse.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,6 @@ public IList<ChatMessage> Messages
6363
/// <summary>Gets or sets the ID of the chat response.</summary>
6464
public string? ResponseId { get; set; }
6565

66-
/// <summary>Gets or sets an identifier for the state of the conversation.</summary>
67-
/// <remarks>
68-
/// Some <see cref="IChatClient"/> implementations are capable of storing the state for a conversation, such that
69-
/// the input messages supplied to <see cref="IChatClient.GetResponseAsync"/> need only be the additional messages beyond
70-
/// what's already stored. If this property is non-<see langword="null"/>, it represents an identifier for that state,
71-
/// and it should be used in a subsequent <see cref="ChatOptions.ConversationId"/> instead of supplying the same messages
72-
/// (and this <see cref="ChatResponse"/>'s message) as part of the <c>messages</c> parameter. Note that the value may
73-
/// or may not differ on every response, depending on whether the underlying provider uses a fixed ID for each conversation
74-
/// or updates it for each message.
75-
/// </remarks>
76-
/// <remarks>This method is obsolete. Use <see cref="ConversationId"/> instead.</remarks>
77-
[Obsolete("Use ConversationId instead.")]
78-
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
79-
public string? ChatThreadId
80-
{
81-
get => ConversationId;
82-
set => ConversationId = value;
83-
}
84-
8566
/// <summary>Gets or sets an identifier for the state of the conversation.</summary>
8667
/// <remarks>
8768
/// Some <see cref="IChatClient"/> implementations are capable of storing the state for a conversation, such that

src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatResponseUpdate.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -116,24 +116,6 @@ public IList<AIContent> Contents
116116
/// </remarks>
117117
public string? MessageId { get; set; }
118118

119-
/// <summary>Gets or sets an identifier for the state of the conversation of which this update is a part.</summary>
120-
/// <remarks>
121-
/// Some <see cref="IChatClient"/> implementations are capable of storing the state for a conversation, such that
122-
/// the input messages supplied to <see cref="IChatClient.GetStreamingResponseAsync"/> need only be the additional messages beyond
123-
/// what's already stored. If this property is non-<see langword="null"/>, it represents an identifier for that state,
124-
/// and it should be used in a subsequent <see cref="ChatOptions.ConversationId"/> instead of supplying the same messages
125-
/// (and this streaming message) as part of the <c>messages</c> parameter. Note that the value may or may not differ on every
126-
/// response, depending on whether the underlying provider uses a fixed ID for each conversation or updates it for each message.
127-
/// </remarks>
128-
/// <remarks>This method is obsolete. Use <see cref="ConversationId"/> instead.</remarks>
129-
[Obsolete("Use ConversationId instead.")]
130-
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
131-
public string? ChatThreadId
132-
{
133-
get => ConversationId;
134-
set => ConversationId = value;
135-
}
136-
137119
/// <summary>Gets or sets an identifier for the state of the conversation of which this update is a part.</summary>
138120
/// <remarks>
139121
/// Some <see cref="IChatClient"/> implementations are capable of storing the state for a conversation, such that

src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/IChatClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ namespace Microsoft.Extensions.AI;
1111
/// <summary>Represents a chat client.</summary>
1212
/// <remarks>
1313
/// <para>
14+
/// Applications must consider risks such as prompt injection attacks, data sizes, and the number of messages
15+
/// sent to the underlying provider or returned from it. Unless a specific <see cref="IChatClient"/> implementation
16+
/// explicitly documents safeguards for these concerns, the application is expected to implement appropriate protections.
17+
/// </para>
18+
/// <para>
1419
/// Unless otherwise specified, all members of <see cref="IChatClient"/> are thread-safe for concurrent use.
1520
/// It is expected that all implementations of <see cref="IChatClient"/> support being used by multiple requests concurrently.
1621
/// Instances must not be disposed of while the instance is still in use.

src/Libraries/Microsoft.Extensions.AI.Abstractions/Embeddings/EmbeddingGenerationOptions.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using System;
5+
using System.Text.Json.Serialization;
46
using Microsoft.Shared.Diagnostics;
57

68
namespace Microsoft.Extensions.AI;
@@ -31,6 +33,25 @@ public int? Dimensions
3133
/// <summary>Gets or sets additional properties for the embedding generation request.</summary>
3234
public AdditionalPropertiesDictionary? AdditionalProperties { get; set; }
3335

36+
/// <summary>
37+
/// Gets or sets a callback responsible for creating the raw representation of the embedding generation options from an underlying implementation.
38+
/// </summary>
39+
/// <remarks>
40+
/// The underlying <see cref="IEmbeddingGenerator" /> implementation may have its own representation of options.
41+
/// When <see cref="IEmbeddingGenerator{TInput, TEmbedding}.GenerateAsync" />
42+
/// is invoked with an <see cref="EmbeddingGenerationOptions" />, that implementation may convert the provided options into
43+
/// its own representation in order to use it while performing the operation. For situations where a consumer knows
44+
/// which concrete <see cref="IEmbeddingGenerator" /> is being used and how it represents options, a new instance of that
45+
/// implementation-specific options type may be returned by this callback, for the <see cref="IEmbeddingGenerator" />
46+
/// implementation to use instead of creating a new instance. Such implementations may mutate the supplied options
47+
/// instance further based on other settings supplied on this <see cref="EmbeddingGenerationOptions" /> instance or from other inputs,
48+
/// therefore, it is <b>strongly recommended</b> to not return shared instances and instead make the callback return a new instance on each call.
49+
/// This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly-typed
50+
/// properties on <see cref="EmbeddingGenerationOptions" />.
51+
/// </remarks>
52+
[JsonIgnore]
53+
public Func<IEmbeddingGenerator, object?>? RawRepresentationFactory { get; set; }
54+
3455
/// <summary>Produces a clone of the current <see cref="EmbeddingGenerationOptions"/> instance.</summary>
3556
/// <returns>A clone of the current <see cref="EmbeddingGenerationOptions"/> instance.</returns>
3657
/// <remarks>

src/Libraries/Microsoft.Extensions.AI.Abstractions/Embeddings/EmbeddingGeneratorExtensions.cs

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -87,35 +87,6 @@ public static TService GetRequiredService<TService>(
8787
return service;
8888
}
8989

90-
/// <summary>Generates an embedding vector from the specified <paramref name="value"/>.</summary>
91-
/// <typeparam name="TInput">The type from which embeddings will be generated.</typeparam>
92-
/// <typeparam name="TEmbeddingElement">The numeric type of the embedding data.</typeparam>
93-
/// <param name="generator">The embedding generator.</param>
94-
/// <param name="value">A value from which an embedding will be generated.</param>
95-
/// <param name="options">The embedding generation options to configure the request.</param>
96-
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
97-
/// <returns>The generated embedding for the specified <paramref name="value"/>.</returns>
98-
/// <exception cref="ArgumentNullException"><paramref name="generator"/> is <see langword="null"/>.</exception>
99-
/// <exception cref="ArgumentNullException"><paramref name="value"/> is <see langword="null"/>.</exception>
100-
/// <exception cref="InvalidOperationException">The generator did not produce exactly one embedding.</exception>
101-
/// <remarks>
102-
/// This operation is equivalent to using <see cref="GenerateAsync"/> and returning the
103-
/// resulting <see cref="Embedding{T}"/>'s <see cref="Embedding{T}.Vector"/> property.
104-
/// </remarks>
105-
/// <remarks>
106-
/// This method is obsolete. Use <see cref="GenerateVectorAsync{TInput, TEmbeddingElement}"/> instead.
107-
/// </remarks>
108-
[Obsolete("Use GenerateVectorAsync<TInput, TEmbeddingElement> instead.")]
109-
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
110-
public static async Task<ReadOnlyMemory<TEmbeddingElement>> GenerateEmbeddingVectorAsync<TInput, TEmbeddingElement>(
111-
this IEmbeddingGenerator<TInput, Embedding<TEmbeddingElement>> generator,
112-
TInput value,
113-
EmbeddingGenerationOptions? options = null,
114-
CancellationToken cancellationToken = default)
115-
{
116-
return await GenerateVectorAsync(generator, value, options, cancellationToken).ConfigureAwait(false);
117-
}
118-
11990
/// <summary>Generates an embedding vector from the specified <paramref name="value"/>.</summary>
12091
/// <typeparam name="TInput">The type from which embeddings will be generated.</typeparam>
12192
/// <typeparam name="TEmbeddingElement">The numeric type of the embedding data.</typeparam>
@@ -141,39 +112,6 @@ public static async Task<ReadOnlyMemory<TEmbeddingElement>> GenerateVectorAsync<
141112
return embedding.Vector;
142113
}
143114

144-
/// <summary>Generates an embedding from the specified <paramref name="value"/>.</summary>
145-
/// <typeparam name="TInput">The type from which embeddings will be generated.</typeparam>
146-
/// <typeparam name="TEmbedding">The type of embedding to generate.</typeparam>
147-
/// <param name="generator">The embedding generator.</param>
148-
/// <param name="value">A value from which an embedding will be generated.</param>
149-
/// <param name="options">The embedding generation options to configure the request.</param>
150-
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
151-
/// <returns>
152-
/// The generated embedding for the specified <paramref name="value"/>.
153-
/// </returns>
154-
/// <exception cref="ArgumentNullException"><paramref name="generator"/> is <see langword="null"/>.</exception>
155-
/// <exception cref="ArgumentNullException"><paramref name="value"/> is <see langword="null"/>.</exception>
156-
/// <exception cref="InvalidOperationException">The generator did not produce exactly one embedding.</exception>
157-
/// <remarks>
158-
/// This operations is equivalent to using <see cref="IEmbeddingGenerator{TInput, TEmbedding}.GenerateAsync"/> with a
159-
/// collection composed of the single <paramref name="value"/> and then returning the first embedding element from the
160-
/// resulting <see cref="GeneratedEmbeddings{TEmbedding}"/> collection.
161-
/// </remarks>
162-
/// <remarks>
163-
/// This method is obsolete. Use <see cref="GenerateAsync{TInput, TEmbedding}"/> instead.
164-
/// </remarks>
165-
[Obsolete("Use GenerateAsync<TInput, TEmbedding> instead.")]
166-
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
167-
public static async Task<TEmbedding> GenerateEmbeddingAsync<TInput, TEmbedding>(
168-
this IEmbeddingGenerator<TInput, TEmbedding> generator,
169-
TInput value,
170-
EmbeddingGenerationOptions? options = null,
171-
CancellationToken cancellationToken = default)
172-
where TEmbedding : Embedding
173-
{
174-
return await GenerateAsync(generator, value, options, cancellationToken).ConfigureAwait(false);
175-
}
176-
177115
/// <summary>Generates an embedding from the specified <paramref name="value"/>.</summary>
178116
/// <typeparam name="TInput">The type from which embeddings will be generated.</typeparam>
179117
/// <typeparam name="TEmbedding">The type of embedding to generate.</typeparam>

src/Libraries/Microsoft.Extensions.AI.Abstractions/Microsoft.Extensions.AI.Abstractions.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<RootNamespace>Microsoft.Extensions.AI</RootNamespace>
5-
<Description>Abstractions for generative AI.</Description>
5+
<Description>Abstractions representing generative AI components.</Description>
66
<Workstream>AI</Workstream>
77
</PropertyGroup>
88

99
<PropertyGroup>
10-
<Stage>preview</Stage>
10+
<Stage>normal</Stage>
1111
<EnablePackageValidation>false</EnablePackageValidation>
1212
<MinCodeCoverage>82</MinCodeCoverage>
13-
<MinMutationScore>0</MinMutationScore>
13+
<MinMutationScore>85</MinMutationScore>
1414
</PropertyGroup>
1515

1616
<PropertyGroup>

0 commit comments

Comments
 (0)