Skip to content

Commit 137d356

Browse files
authored
feat: Update M.E.AI to 9.0.1-preview.1.24570.5 (#48)
1 parent bf1e59f commit 137d356

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/libs/HuggingFace/Extensions/HuggingFaceApi.ChatClient.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ public sealed partial class HuggingFaceClient : IChatClient
1212
ChatClientMetadata IChatClient.Metadata => _metadata ??= new(nameof(HuggingFaceClient), this.BaseUri);
1313

1414
/// <inheritdoc />
15-
TService? IChatClient.GetService<TService>(object? key) where TService : class => this as TService;
15+
object? IChatClient.GetService(Type serviceType, object? key)
16+
{
17+
return key is null && serviceType?.IsInstanceOfType(this) is true ? this : null;
18+
}
1619

1720
/// <inheritdoc />
1821
async Task<ChatCompletion> IChatClient.CompleteAsync(IList<ChatMessage> chatMessages, ChatOptions? options, CancellationToken cancellationToken)
@@ -48,7 +51,7 @@ async Task<ChatCompletion> IChatClient.CompleteAsync(IList<ChatMessage> chatMess
4851
Temperature = options?.Temperature,
4952
TopP = options?.TopP,
5053
TopK = options?.TopK,
51-
54+
5255
DoSample = options?.AdditionalProperties?[nameof(GenerateTextRequestParameters.DoSample)],
5356
MaxTime = options?.AdditionalProperties?.TryGetValue(nameof(GenerateTextRequestParameters.MaxTime), out double maxTime) is true ? maxTime : null,
5457
NumReturnSequences = options?.AdditionalProperties?.TryGetValue(nameof(GenerateTextRequestParameters.NumReturnSequences), out int numReturnSequences) is true ? numReturnSequences : null,

src/libs/HuggingFace/HuggingFace.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<ItemGroup>
1919
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.0" />
20-
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.0.0-preview.9.24556.5" />
20+
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.0.1-preview.1.24570.5" />
2121
<PackageReference Include="PolySharp" Version="1.14.1">
2222
<PrivateAssets>all</PrivateAssets>
2323
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 commit comments

Comments
 (0)