-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIAIClientProvider.cs
More file actions
72 lines (63 loc) · 4.71 KB
/
Copy pathIAIClientProvider.cs
File metadata and controls
72 lines (63 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using CrestApps.Core.AI.Models;
using Microsoft.Extensions.AI;
namespace CrestApps.Core.AI.Clients;
/// <summary>
/// Provides methods to obtain AI chat clients and embedding generators for specific providers.
/// </summary>
public interface IAIClientProvider
{
/// <summary>
/// Determines whether this provider can handle the specified provider name.
/// </summary>
/// <param name = "clientName">The name of the provider to check.</param>
/// <returns><c>true</c> if the provider can be handled; otherwise, <c>false</c>.</returns>
bool CanHandle(string clientName);
/// <summary>
/// Gets an AI chat client for the specified connection and deployment.
/// </summary>
/// <param name = "connection">The connection entry containing provider configuration.</param>
/// <param name = "deploymentName">The optional deployment name to use.</param>
/// <returns>A <see cref = "ValueTask{IChatClient}"/> representing the asynchronous operation.</returns>
ValueTask<IChatClient> GetChatClientAsync(AIProviderConnectionEntry connection, string deploymentName = null);
/// <summary>
/// Gets an embedding generator for the specified connection and deployment.
/// </summary>
/// <param name = "connection">The connection entry containing provider configuration.</param>
/// <param name = "deploymentName">The optional deployment name to use.</param>
/// <returns>A <see cref = "ValueTask{IEmbeddingGenerator}"/> representing the asynchronous operation.</returns>
ValueTask<IEmbeddingGenerator<string, Embedding<float>>> GetEmbeddingGeneratorAsync(AIProviderConnectionEntry connection, string deploymentName = null);
/// <summary>
/// Gets an image generator for the specified connection and deployment.
/// </summary>
/// <param name = "connection">The connection entry containing provider configuration.</param>
/// <param name = "deploymentName">The optional deployment name to use.</param>
/// <returns>A <see cref = "ValueTask{IImageGenerator}"/> representing the asynchronous operation.</returns>
#pragma warning disable MEAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
ValueTask<IImageGenerator> GetImageGeneratorAsync(AIProviderConnectionEntry connection, string deploymentName = null);
#pragma warning restore MEAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
/// <summary>
/// Gets a speech-to-text client for the specified connection and deployment.
/// </summary>
/// <param name = "connection">The connection entry containing provider configuration.</param>
/// <param name = "deploymentName">The optional deployment name to use.</param>
/// <returns>A <see cref = "ValueTask{ISpeechToTextClient}"/> representing the asynchronous operation.</returns>
#pragma warning disable MEAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
ValueTask<ISpeechToTextClient> GetSpeechToTextClientAsync(AIProviderConnectionEntry connection, string deploymentName = null);
#pragma warning restore MEAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
/// <summary>
/// Gets a text-to-speech client for the specified connection and deployment.
/// </summary>
/// <param name = "connection">The connection entry containing provider configuration.</param>
/// <param name = "deploymentName">The optional deployment name to use.</param>
/// <returns>A <see cref = "ValueTask{ITextToSpeechClient}"/> representing the asynchronous operation.</returns>
#pragma warning disable MEAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
ValueTask<ITextToSpeechClient> GetTextToSpeechClientAsync(AIProviderConnectionEntry connection, string deploymentName = null);
#pragma warning restore MEAI001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
/// <summary>
/// Gets the available speech voices for the specified connection and deployment.
/// </summary>
/// <param name = "connection">The connection entry containing provider configuration.</param>
/// <param name = "deploymentName">The optional deployment name to use.</param>
/// <returns>An array of available <see cref = "SpeechVoice"/> instances.</returns>
Task<SpeechVoice[]> GetSpeechVoicesAsync(AIProviderConnectionEntry connection, string deploymentName = null);
}