1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
- using System ;
5
- using System . ComponentModel ;
6
4
using System . Diagnostics . CodeAnalysis ;
7
- using Microsoft . Shared . Diagnostics ;
8
5
using OpenAI ;
9
6
using OpenAI . Audio ;
10
7
using OpenAI . Chat ;
@@ -16,15 +13,6 @@ namespace Microsoft.Extensions.AI;
16
13
/// <summary>Provides extension methods for working with <see cref="OpenAIClient"/>s.</summary>
17
14
public static class OpenAIClientExtensions
18
15
{
19
- /// <summary>Gets an <see cref="IChatClient"/> for use with this <see cref="OpenAIClient"/>.</summary>
20
- /// <param name="openAIClient">The client.</param>
21
- /// <param name="modelId">The model.</param>
22
- /// <returns>An <see cref="IChatClient"/> that can be used to converse via the <see cref="OpenAIClient"/>.</returns>
23
- [ EditorBrowsable ( EditorBrowsableState . Never ) ]
24
- [ Obsolete ( "This method will be removed in an upcoming release." ) ]
25
- public static IChatClient AsChatClient ( this OpenAIClient openAIClient , string modelId ) =>
26
- new OpenAIChatClient ( Throw . IfNull ( openAIClient ) . GetChatClient ( modelId ) ) ;
27
-
28
16
/// <summary>Gets an <see cref="IChatClient"/> for use with this <see cref="ChatClient"/>.</summary>
29
17
/// <param name="chatClient">The client.</param>
30
18
/// <returns>An <see cref="IChatClient"/> that can be used to converse via the <see cref="ChatClient"/>.</returns>
@@ -44,16 +32,6 @@ public static IChatClient AsIChatClient(this OpenAIResponseClient responseClient
44
32
public static ISpeechToTextClient AsISpeechToTextClient ( this AudioClient audioClient ) =>
45
33
new OpenAISpeechToTextClient ( audioClient ) ;
46
34
47
- /// <summary>Gets an <see cref="IEmbeddingGenerator{String, Single}"/> for use with this <see cref="OpenAIClient"/>.</summary>
48
- /// <param name="openAIClient">The client.</param>
49
- /// <param name="modelId">The model to use.</param>
50
- /// <param name="dimensions">The number of dimensions to generate in each embedding.</param>
51
- /// <returns>An <see cref="IEmbeddingGenerator{String, Embedding}"/> that can be used to generate embeddings via the <see cref="EmbeddingClient"/>.</returns>
52
- [ EditorBrowsable ( EditorBrowsableState . Never ) ]
53
- [ Obsolete ( "This method will be removed in an upcoming release." ) ]
54
- public static IEmbeddingGenerator < string , Embedding < float > > AsEmbeddingGenerator ( this OpenAIClient openAIClient , string modelId , int ? dimensions = null ) =>
55
- new OpenAIEmbeddingGenerator ( Throw . IfNull ( openAIClient ) . GetEmbeddingClient ( modelId ) , dimensions ) ;
56
-
57
35
/// <summary>Gets an <see cref="IEmbeddingGenerator{String, Single}"/> for use with this <see cref="EmbeddingClient"/>.</summary>
58
36
/// <param name="embeddingClient">The client.</param>
59
37
/// <param name="defaultModelDimensions">The number of dimensions to generate in each embedding.</param>
0 commit comments