11 implementations of IChatClient
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\DelegatingChatClient.cs (1)
20
public class DelegatingChatClient :
IChatClient
Microsoft.Extensions.AI.Abstractions.Tests (1)
TestChatClient.cs (1)
11
public sealed class TestChatClient :
IChatClient
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
24
internal sealed class AzureAIInferenceChatClient :
IChatClient
Microsoft.Extensions.AI.Evaluation.Safety (1)
ContentSafetyChatClient.cs (1)
17
internal sealed class ContentSafetyChatClient :
IChatClient
Microsoft.Extensions.AI.Integration.Tests (2)
ChatClientIntegrationTests.cs (1)
1349
private sealed class TestSummarizingChatClient :
IChatClient
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestChatClient.cs (1)
11
public sealed class TestChatClient :
IChatClient
Microsoft.Extensions.AI.OpenAI (3)
OpenAIAssistantsChatClient.cs (1)
24
internal sealed class OpenAIAssistantsChatClient :
IChatClient
OpenAIChatClient.cs (1)
27
internal sealed partial class OpenAIChatClient :
IChatClient
OpenAIResponsesChatClient.cs (1)
25
internal sealed class OpenAIResponsesChatClient :
IChatClient
Microsoft.Extensions.AI.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestChatClient.cs (1)
11
public sealed class TestChatClient :
IChatClient
Microsoft.ML.GenAI.Core (1)
CausalLMPipelineChatClient.cs (1)
17
public abstract class CausalLMPipelineChatClient<TTokenizer, TCausalLMModel> :
IChatClient
495 references to IChatClient
Aspire.Azure.AI.Inference (5)
AspireAzureAIInferenceExtensions.cs (5)
177
/// Creates a <see cref="
IChatClient
"/> from the <see cref="ChatCompletionsClient"/> registered in the service collection.
191
/// Creates a <see cref="
IChatClient
"/> from the <see cref="ChatCompletionsClient"/> registered in the service collection.
194
/// <param name="serviceKey">The service key with which the <see cref="
IChatClient
"/> will be registered.</param>
208
private static
IChatClient
CreateInnerChatClient(AspireChatCompletionsClientBuilder builder, IServiceProvider services, string? deploymentName)
214
var
result = chatCompletionsClient.AsIChatClient(deploymentName ?? builder.DeploymentName);
Aspire.Azure.AI.Inference.Tests (8)
AspireAzureAIInferenceExtensionTests.cs (6)
107
var
client = useKeyed ?
108
host.Services.GetKeyedService<
IChatClient
>("inference") :
109
host.Services.GetService<
IChatClient
>();
132
var
client = useKeyed ?
133
host.Services.GetKeyedService<
IChatClient
>("inference") :
134
host.Services.GetService<
IChatClient
>();
ConformanceTests.cs (2)
13
public class ConformanceTests : ConformanceTests<
IChatClient
, ChatCompletionsClientSettings>
81
protected override void TriggerActivity(
IChatClient
service)
Aspire.Azure.AI.OpenAI.Tests (25)
AspireAzureOpenAIClientBuilderChatClientExtensionsTests.cs (20)
35
var
client = useKeyed ?
36
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
37
host.Services.GetRequiredService<
IChatClient
>();
65
var
client = useKeyed ?
66
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
67
host.Services.GetRequiredService<
IChatClient
>();
93
var
client = useKeyed ?
94
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
95
host.Services.GetRequiredService<
IChatClient
>();
125
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
126
host.Services.GetRequiredService<
IChatClient
>();
156
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
157
host.Services.GetRequiredService<
IChatClient
>();
186
var
client = useKeyed ?
187
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
188
host.Services.GetRequiredService<
IChatClient
>();
213
var
client = useKeyed ?
214
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
215
host.Services.GetRequiredService<
IChatClient
>();
220
static Task<ChatResponse> TestMiddleware(IEnumerable<ChatMessage> list, ChatOptions? options,
IChatClient
client, CancellationToken token)
AspireConfigurableOpenAIExtensionsTests.cs (3)
243
var
chatClient = useKeyed ?
244
host.Services.GetRequiredKeyedService<
IChatClient
>("chat") :
245
host.Services.GetRequiredService<
IChatClient
>();
ConformanceTests.cs (2)
16
public class ConformanceTests : ConformanceTests<
IChatClient
, AzureOpenAISettings>
105
protected override void TriggerActivity(
IChatClient
service)
Aspire.Dashboard (5)
Model\Assistant\AIHelpers.cs (1)
335
IChatClient
client,
Model\Assistant\AssistantChatViewModel.cs (2)
195
private
IChatClient
_client = null!;
196
private
IChatClient
_followUpClient = null!;
Model\Assistant\ChatClientFactory.cs (2)
45
public
IChatClient
CreateClient(string model)
49
var
innerChatClient = new OpenAI.Chat.ChatClient(
Aspire.OpenAI (8)
AspireOpenAIClientBuilderChatClientExtensions.cs (8)
13
/// Provides extension methods for registering <see cref="
IChatClient
"/> as a singleton in the services provided by the <see cref="IHostApplicationBuilder"/>.
18
/// Registers a singleton <see cref="
IChatClient
"/> in the services provided by the <paramref name="builder"/>.
22
/// <returns>A <see cref="ChatClientBuilder"/> that can be used to build a pipeline around the inner <see cref="
IChatClient
"/>.</returns>
34
/// Registers a keyed singleton <see cref="
IChatClient
"/> in the services provided by the <paramref name="builder"/>.
37
/// <param name="serviceKey">The service key with which the <see cref="
IChatClient
"/> will be registered.</param>
39
/// <returns>A <see cref="ChatClientBuilder"/> that can be used to build a pipeline around the inner <see cref="
IChatClient
"/>.</returns>
58
private static
IChatClient
CreateInnerChatClient(
68
var
result = openAiClient.GetChatClient(deploymentName).AsIChatClient();
Aspire.OpenAI.Tests (25)
AspireOpenAIClientBuilderChatClientExtensionsTests.cs (23)
38
var
client = useKeyed ?
39
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
40
host.Services.GetRequiredService<
IChatClient
>();
68
var
client = useKeyed ?
69
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
70
host.Services.GetRequiredService<
IChatClient
>();
96
var
client = useKeyed ?
97
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
98
host.Services.GetRequiredService<
IChatClient
>();
128
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
129
host.Services.GetRequiredService<
IChatClient
>();
159
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
160
host.Services.GetRequiredService<
IChatClient
>();
189
var
client = useKeyed ?
190
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
191
host.Services.GetRequiredService<
IChatClient
>();
216
var
client = useKeyed ?
217
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
218
host.Services.GetRequiredService<
IChatClient
>();
249
var
client = useKeyed ?
250
host.Services.GetRequiredKeyedService<
IChatClient
>("openai_chatclient") :
251
host.Services.GetRequiredService<
IChatClient
>();
268
private static Task<ChatResponse> TestMiddleware(IEnumerable<ChatMessage> list, ChatOptions? options,
IChatClient
client, CancellationToken token)
ConformanceTests.cs (2)
14
public class ConformanceTests : ConformanceTests<
IChatClient
, OpenAISettings>
85
protected override void TriggerActivity(
IChatClient
service)
AzureAIFoundryEndToEnd.WebStory (1)
Components_Pages_Home_razor.g.cs (1)
201
IChatClient
AzureOpenAIEndToEnd.WebStory (1)
Components_Pages_Home_razor.g.cs (1)
201
IChatClient
GitHubModelsEndToEnd.WebStory (1)
Components_Pages_Home_razor.g.cs (1)
201
IChatClient
Microsoft.Extensions.AI (106)
ChatCompletion\AnonymousDelegatingChatClient.cs (6)
21
private readonly Func<IEnumerable<ChatMessage>, ChatOptions?,
IChatClient
, CancellationToken, Task<ChatResponse>>? _getResponseFunc;
29
private readonly Func<IEnumerable<ChatMessage>, ChatOptions?,
IChatClient
, CancellationToken, IAsyncEnumerable<ChatResponseUpdate>>? _getStreamingResponseFunc;
50
IChatClient
innerClient,
76
IChatClient
innerClient,
77
Func<IEnumerable<ChatMessage>, ChatOptions?,
IChatClient
, CancellationToken, Task<ChatResponse>>? getResponseFunc,
78
Func<IEnumerable<ChatMessage>, ChatOptions?,
IChatClient
, CancellationToken, IAsyncEnumerable<ChatResponseUpdate>>? getStreamingResponseFunc)
ChatCompletion\CachingChatClient.cs (7)
25
/// <param name="innerClient">The underlying <see cref="
IChatClient
"/>.</param>
26
protected CachingChatClient(
IChatClient
innerClient)
154
/// This is used when there is a call to <see cref="
IChatClient
.GetResponseAsync"/>.
164
/// This is used when there is a call to <see cref="
IChatClient
.GetStreamingResponseAsync"/>.
174
/// This is used when there is a call to <see cref="
IChatClient
.GetResponseAsync"/>.
186
/// This is used when there is a call to <see cref="
IChatClient
.GetStreamingResponseAsync"/>.
203
/// be passed through to the inner <see cref="
IChatClient
"/> without attempting to read from or write to the cache.
ChatCompletion\ChatClientBuilder.cs (34)
12
/// <summary>A builder for creating pipelines of <see cref="
IChatClient
"/>.</summary>
15
private readonly Func<IServiceProvider,
IChatClient
> _innerClientFactory;
18
private List<Func<
IChatClient
, IServiceProvider,
IChatClient
>>? _clientFactories;
21
/// <param name="innerClient">The inner <see cref="
IChatClient
"/> that represents the underlying backend.</param>
23
public ChatClientBuilder(
IChatClient
innerClient)
30
/// <param name="innerClientFactory">A callback that produces the inner <see cref="
IChatClient
"/> that represents the underlying backend.</param>
31
public ChatClientBuilder(Func<IServiceProvider,
IChatClient
> innerClientFactory)
36
/// <summary>Builds an <see cref="
IChatClient
"/> that represents the entire pipeline. Calls to this instance will pass through each of the pipeline stages in turn.</summary>
38
/// The <see cref="IServiceProvider"/> that should provide services to the <see cref="
IChatClient
"/> instances.
41
/// <returns>An instance of <see cref="
IChatClient
"/> that represents the entire pipeline.</returns>
42
public
IChatClient
Build(IServiceProvider? services = null)
45
var
chatClient = _innerClientFactory(services);
57
$"Ensure that the callbacks passed to {nameof(Use)} return non-null {nameof(
IChatClient
)} instances.");
70
public ChatClientBuilder Use(Func<
IChatClient
,
IChatClient
> clientFactory)
82
public ChatClientBuilder Use(Func<
IChatClient
, IServiceProvider,
IChatClient
> clientFactory)
92
/// an implementation for both <see cref="
IChatClient
.GetResponseAsync"/> and <see cref="
IChatClient
.GetStreamingResponseAsync"/>.
95
/// A delegate that provides the implementation for both <see cref="
IChatClient
.GetResponseAsync"/> and
96
/// <see cref="
IChatClient
.GetStreamingResponseAsync"/>. This delegate is invoked with the list of chat messages, the chat
117
/// an implementation for both <see cref="
IChatClient
.GetResponseAsync"/> and <see cref="
IChatClient
.GetStreamingResponseAsync"/>.
120
/// A delegate that provides the implementation for <see cref="
IChatClient
.GetResponseAsync"/>. When <see langword="null"/>,
121
/// <paramref name="getStreamingResponseFunc"/> must be non-null, and the implementation of <see cref="
IChatClient
.GetResponseAsync"/>
125
/// A delegate that provides the implementation for <see cref="
IChatClient
.GetStreamingResponseAsync"/>. When <see langword="null"/>,
126
/// <paramref name="getResponseFunc"/> must be non-null, and the implementation of <see cref="
IChatClient
.GetStreamingResponseAsync"/>
132
/// <paramref name="getResponseFunc"/> will provide the implementation of <see cref="
IChatClient
.GetResponseAsync"/>, and
133
/// <paramref name="getStreamingResponseFunc"/> will provide the implementation of <see cref="
IChatClient
.GetStreamingResponseAsync"/>.
135
/// is supplied without <paramref name="getStreamingResponseFunc"/>, the implementation of <see cref="
IChatClient
.GetStreamingResponseAsync"/>
138
/// <see cref="
IChatClient
.GetResponseAsync"/> will be implemented by combining the updates from <paramref name="getStreamingResponseFunc"/>.
143
Func<IEnumerable<ChatMessage>, ChatOptions?,
IChatClient
, CancellationToken, Task<ChatResponse>>? getResponseFunc,
144
Func<IEnumerable<ChatMessage>, ChatOptions?,
IChatClient
, CancellationToken, IAsyncEnumerable<ChatResponseUpdate>>? getStreamingResponseFunc)
ChatCompletion\ChatClientBuilderChatClientExtensions.cs (2)
9
/// <summary>Provides extension methods for working with <see cref="
IChatClient
"/> in the context of <see cref="ChatClientBuilder"/>.</summary>
20
public static ChatClientBuilder AsBuilder(this
IChatClient
innerClient)
ChatCompletion\ChatClientBuilderServiceCollectionExtensions.cs (15)
10
/// <summary>Provides extension methods for registering <see cref="
IChatClient
"/> with a <see cref="IServiceCollection"/>.</summary>
13
/// <summary>Registers a singleton <see cref="
IChatClient
"/> in the <see cref="IServiceCollection"/>.</summary>
15
/// <param name="innerClient">The inner <see cref="
IChatClient
"/> that represents the underlying backend.</param>
23
IChatClient
innerClient,
32
/// <summary>Registers a singleton <see cref="
IChatClient
"/> in the <see cref="IServiceCollection"/>.</summary>
34
/// <param name="innerClientFactory">A callback that produces the inner <see cref="
IChatClient
"/> that represents the underlying backend.</param>
42
Func<IServiceProvider,
IChatClient
> innerClientFactory,
49
serviceCollection.Add(new ServiceDescriptor(typeof(
IChatClient
), builder.Build, lifetime));
53
/// <summary>Registers a keyed singleton <see cref="
IChatClient
"/> in the <see cref="IServiceCollection"/>.</summary>
56
/// <param name="innerClient">The inner <see cref="
IChatClient
"/> that represents the underlying backend.</param>
65
IChatClient
innerClient,
74
/// <summary>Registers a keyed singleton <see cref="
IChatClient
"/> in the <see cref="IServiceCollection"/>.</summary>
77
/// <param name="innerClientFactory">A callback that produces the inner <see cref="
IChatClient
"/> that represents the underlying backend.</param>
86
Func<IServiceProvider,
IChatClient
> innerClientFactory,
93
serviceCollection.Add(new ServiceDescriptor(typeof(
IChatClient
), serviceKey, factory: (services, serviceKey) => builder.Build(services), lifetime));
ChatCompletion\ChatClientStructuredOutputExtensions.cs (13)
19
/// Provides extension methods on <see cref="
IChatClient
"/> that simplify working with structured output.
25
/// <param name="chatClient">The <see cref="
IChatClient
"/>.</param>
36
this
IChatClient
chatClient,
44
/// <param name="chatClient">The <see cref="
IChatClient
"/>.</param>
56
this
IChatClient
chatClient,
64
/// <param name="chatClient">The <see cref="
IChatClient
"/>.</param>
75
this
IChatClient
chatClient,
83
/// <param name="chatClient">The <see cref="
IChatClient
"/>.</param>
95
this
IChatClient
chatClient,
104
/// <param name="chatClient">The <see cref="
IChatClient
"/>.</param>
116
this
IChatClient
chatClient,
125
/// <param name="chatClient">The <see cref="
IChatClient
"/>.</param>
138
this
IChatClient
chatClient,
ChatCompletion\ConfigureOptionsChatClient.cs (1)
30
public ConfigureOptionsChatClient(
IChatClient
innerClient, Action<ChatOptions> configure)
ChatCompletion\DistributedCachingChatClient.cs (3)
31
/// The provided implementation of <see cref="
IChatClient
"/> is thread-safe for concurrent use so long as the employed
51
/// <param name="innerClient">The underlying <see cref="
IChatClient
"/>.</param>
53
public DistributedCachingChatClient(
IChatClient
innerClient, IDistributedCache storage)
ChatCompletion\DistributedCachingChatClientBuilderExtensions.cs (1)
13
/// Extension methods for adding a <see cref="DistributedCachingChatClient"/> to an <see cref="
IChatClient
"/> pipeline.
ChatCompletion\FunctionInvocationContext.cs (3)
96
/// If multiple function call requests are issued as part of a single iteration (a single response from the inner <see cref="
IChatClient
"/>),
104
/// <see cref="
IChatClient
.GetStreamingResponseAsync"/> call as opposed to a <see cref="
IChatClient
.GetResponseAsync"/> call.
ChatCompletion\FunctionInvokingChatClient.cs (11)
31
/// <see cref="
IChatClient
"/>, it responds by invoking the corresponding <see cref="AIFunction"/> defined
50
/// Due to the nature of interactions with an underlying <see cref="
IChatClient
"/>, if any <see cref="FunctionCallContent"/> is received
91
/// <param name="innerClient">The underlying <see cref="
IChatClient
"/>, or the next instance in a chain of clients.</param>
94
public FunctionInvokingChatClient(
IChatClient
innerClient, ILoggerFactory? loggerFactory = null, IServiceProvider? functionInvocationServices = null)
116
/// in the chat history when calling the underlying <see cref="
IChatClient
"/>.
120
/// when calling the underlying <see cref="
IChatClient
"/>.
132
/// Setting the value to <see langword="true"/> can help the underlying <see cref="
IChatClient
"/> bypass problems on
204
/// controlled by <see cref="IncludeDetailedErrors"/>). This allows the <see cref="
IChatClient
"/> to
332
Throw.InvalidOperationException($"The inner {nameof(
IChatClient
)} returned a null {nameof(ChatResponse)}.");
502
Throw.InvalidOperationException($"The inner {nameof(
IChatClient
)} streamed a null {nameof(ChatResponseUpdate)}.");
1455
/// using the same message id that the <see cref="FunctionCallContent"/> was originally returned with from the downstream <see cref="
IChatClient
"/>.
ChatCompletion\LoggingChatClient.cs (3)
18
/// The provided implementation of <see cref="
IChatClient
"/> is thread-safe for concurrent use so long as the
37
/// <param name="innerClient">The underlying <see cref="
IChatClient
"/>.</param>
39
public LoggingChatClient(
IChatClient
innerClient, ILogger logger)
ChatCompletion\OpenTelemetryChatClient.cs (2)
44
/// <param name="innerClient">The underlying <see cref="
IChatClient
"/>.</param>
48
public OpenTelemetryChatClient(
IChatClient
innerClient, ILogger? logger = null, string? sourceName = null)
ChatCompletion\ReducingChatClient.cs (2)
22
/// <param name="innerClient">The underlying <see cref="
IChatClient
"/>, or the next instance in a chain of clients.</param>
24
public ReducingChatClient(
IChatClient
innerClient, IChatReducer reducer)
ChatReduction\SummarizingChatReducer.cs (3)
44
private readonly
IChatClient
_chatClient;
66
public SummarizingChatReducer(
IChatClient
chatClient, int targetCount, int? threshold)
120
IChatClient
chatClient, int targetCount, string summarizationPrompt, CancellationToken cancellationToken)
Microsoft.Extensions.AI.Abstractions (53)
ChatCompletion\AutoChatToolMode.cs (1)
9
/// Indicates that an <see cref="
IChatClient
"/> is free to select any of the available tools, or none at all.
ChatCompletion\ChatClientExtensions.cs (14)
12
/// <summary>Provides a collection of static methods for extending <see cref="
IChatClient
"/> instances.</summary>
15
/// <summary>Asks the <see cref="
IChatClient
"/> for an object of type <typeparamref name="TService"/>.</summary>
22
/// The purpose of this method is to allow for the retrieval of strongly typed services that may be provided by the <see cref="
IChatClient
"/>,
25
public static TService? GetService<TService>(this
IChatClient
client, object? serviceKey = null)
33
/// Asks the <see cref="
IChatClient
"/> for an object of the specified type <paramref name="serviceType"/>
44
/// The purpose of this method is to allow for the retrieval of services that are required to be provided by the <see cref="
IChatClient
"/>,
47
public static object GetRequiredService(this
IChatClient
client, Type serviceType, object? serviceKey = null)
58
/// Asks the <see cref="
IChatClient
"/> for an object of type <typeparamref name="TService"/>
68
/// The purpose of this method is to allow for the retrieval of strongly typed services that are required to be provided by the <see cref="
IChatClient
"/>,
71
public static TService GetRequiredService<TService>(this
IChatClient
client, object? serviceKey = null)
92
this
IChatClient
client,
112
this
IChatClient
client,
132
this
IChatClient
client,
152
this
IChatClient
client,
ChatCompletion\ChatClientMetadata.cs (2)
8
/// <summary>Provides metadata about an <see cref="
IChatClient
"/>.</summary>
37
/// This value can be <see langword="null"/> if no default model is set on the corresponding <see cref="
IChatClient
"/>.
ChatCompletion\ChatMessage.cs (1)
12
/// <summary>Represents a chat message used by an <see cref="
IChatClient
" />.</summary>
ChatCompletion\ChatOptions.cs (8)
18
/// <summary>Gets or sets additional per-request instructions to be provided to the <see cref="
IChatClient
"/>.</summary>
94
/// If <see langword="false"/>, the <see cref="
IChatClient
"/> is asked to return a maximum of one tool call per request.
122
/// The underlying <see cref="
IChatClient
" /> implementation may have its own representation of options.
123
/// When <see cref="
IChatClient
.GetResponseAsync" /> or <see cref="
IChatClient
.GetStreamingResponseAsync" />
126
/// which concrete <see cref="
IChatClient
" /> is being used and how it represents options, a new instance of that
127
/// implementation-specific options type may be returned by this callback, for the <see cref="
IChatClient
" />
136
public Func<
IChatClient
, object?>? RawRepresentationFactory { get; set; }
ChatCompletion\ChatResponse.cs (4)
17
/// request to a <see cref="
IChatClient
"/> may actually generate multiple roundtrips to an inner <see cref="
IChatClient
"/>
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
ChatCompletion\ChatResponseUpdate.cs (3)
13
/// Represents a single streaming response chunk from an <see cref="
IChatClient
"/>.
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
ChatCompletion\ChatToolMode.cs (4)
9
/// Describes how tools should be selected by a <see cref="
IChatClient
"/>.
34
/// instances, and the <see cref="
IChatClient
"/> is free to invoke zero or more of them.
43
/// instances, but the <see cref="
IChatClient
"/> should not request the invocation of
44
/// any of them. This can be used when the <see cref="
IChatClient
"/> should know about
ChatCompletion\DelegatingChatClient.cs (5)
13
/// Provides an optional base class for an <see cref="
IChatClient
"/> that passes through calls to another instance.
16
/// This is recommended as a base type when building clients that can be chained around an underlying <see cref="
IChatClient
"/>.
27
protected DelegatingChatClient(
IChatClient
innerClient)
39
/// <summary>Gets the inner <see cref="
IChatClient
" />.</summary>
40
protected
IChatClient
InnerClient { get; }
ChatCompletion\IChatClient.cs (7)
15
/// sent to the underlying provider or returned from it. Unless a specific <see cref="
IChatClient
"/> implementation
19
/// Unless otherwise specified, all members of <see cref="
IChatClient
"/> are thread-safe for concurrent use.
20
/// It is expected that all implementations of <see cref="
IChatClient
"/> support being used by multiple requests concurrently.
24
/// However, implementations of <see cref="
IChatClient
"/> might mutate the arguments supplied to <see cref="GetResponseAsync"/> and
27
/// that no <see cref="
IChatClient
"/> instances are used which might employ such mutation. For example, the ConfigureOptions method is
59
/// <summary>Asks the <see cref="
IChatClient
"/> for an object of the specified type <paramref name="serviceType"/>.</summary>
65
/// The purpose of this method is to allow for the retrieval of strongly-typed services that might be provided by the <see cref="
IChatClient
"/>,
ChatCompletion\NoneChatToolMode.cs (1)
9
/// Indicates that an <see cref="
IChatClient
"/> should not request the invocation of any tools.
Tools\HostedCodeInterpreterTool.cs (1)
24
/// Unsupported inputs will be ignored by the <see cref="
IChatClient
"/> to which the tool is passed.
Utilities\AIJsonSchemaTransformCache.cs (2)
17
/// to their corresponding JSON schemas transformed according to the specified <see cref="TransformOptions"/> policy. It is intended for use by <see cref="
IChatClient
"/>
21
/// It is recommended <see cref="
IChatClient
"/> implementations with schema transformation requirements create a single static instance of this cache.
Microsoft.Extensions.AI.Abstractions.Tests (7)
ChatCompletion\ChatClientExtensionsTests.cs (3)
42
if (serviceType == typeof(
IChatClient
))
57
Assert.Null(client.GetService<
IChatClient
>());
69
Assert.Throws<InvalidOperationException>(() => client.GetRequiredService<
IChatClient
>());
ChatCompletion\ChatOptionsTests.cs (1)
77
Func<
IChatClient
, object?> rawRepresentationFactory = (c) => null;
ChatCompletion\DelegatingChatClientTests.cs (3)
126
var
client = delegating.GetService<
IChatClient
>(expectedKey);
163
private sealed class NoOpDelegatingChatClient(
IChatClient
innerClient)
Microsoft.Extensions.AI.AzureAIInference (5)
AzureAIInferenceChatClient.cs (2)
23
/// <summary>Represents an <see cref="
IChatClient
"/> for an Azure AI Inference <see cref="ChatCompletionsClient"/>.</summary>
71
object?
IChatClient
.GetService(Type serviceType, object? serviceKey)
AzureAIInferenceExtensions.cs (3)
11
/// <summary>Gets an <see cref="
IChatClient
"/> for use with this <see cref="ChatCompletionsClient"/>.</summary>
14
/// <returns>An <see cref="
IChatClient
"/> that can be used to converse via the <see cref="ChatCompletionsClient"/>.</returns>
15
public static
IChatClient
AsIChatClient(
Microsoft.Extensions.AI.AzureAIInference.Tests (26)
AzureAIInferenceChatClientIntegrationTests.cs (1)
8
protected override
IChatClient
? CreateChatClient() =>
AzureAIInferenceChatClientTests.cs (25)
40
IChatClient
chatClient = client.AsIChatClient(modelId: null);
57
IChatClient
chatClient = client.AsIChatClient(model);
68
IChatClient
chatClient = client.AsIChatClient("model");
70
Assert.Same(chatClient, chatClient.GetService<
IChatClient
>());
73
using
IChatClient
pipeline = chatClient
87
Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<
IChatClient
>());
142
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
215
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
252
using
IChatClient
client = CreateChatClient(httpClient, modelId: null!);
269
using
IChatClient
client = CreateChatClient(httpClient, modelId: null!);
327
using
IChatClient
client = CreateChatClient(httpClient, modelId: null!);
411
using
IChatClient
client = CreateChatClient(httpClient, modelId: null!);
500
using
IChatClient
client = CreateChatClient(httpClient, modelId: null!);
575
using
IChatClient
client = CreateChatClient(httpClient, modelId: null!);
682
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
741
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
792
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
828
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
885
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
982
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1065
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1128
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1247
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1333
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1364
private static
IChatClient
CreateChatClient(HttpClient httpClient, string modelId) =>
Microsoft.Extensions.AI.Evaluation (14)
ChatConfiguration.cs (5)
7
/// Specifies the <see cref="
IChatClient
"/> that should be used when evaluation is performed using an AI model.
9
/// <param name="chatClient">An <see cref="
IChatClient
"/> that can be used to communicate with an AI model.</param>
10
public sealed class ChatConfiguration(
IChatClient
chatClient)
13
/// Gets an <see cref="
IChatClient
"/> that can be used to communicate with an AI model.
15
public
IChatClient
ChatClient { get; } = chatClient;
CompositeEvaluator.cs (1)
89
/// A <see cref="ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that should be used if one or
EvaluatorExtensions.cs (6)
33
/// A <see cref="ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that should be used if one or
76
/// A <see cref="ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that should be used if one or
118
/// A <see cref="ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that should be used if one or
158
/// A <see cref="ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that should be used if one or
206
/// A <see cref="ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that should be used if one or
251
/// A <see cref="ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that should be used if one or
IEvaluator.cs (1)
43
/// A <see cref="ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that should be used if one or
Utilities\ModelInfo.cs (1)
74
/// The <see cref="ChatClientMetadata"/> for the <see cref="
IChatClient
"/> that was used to communicate with the
Microsoft.Extensions.AI.Evaluation.Console (1)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (1)
74
/// The <see cref="ChatClientMetadata"/> for the <see cref="
IChatClient
"/> that was used to communicate with the
Microsoft.Extensions.AI.Evaluation.Integration.Tests (12)
AgentQualityEvaluatorTests.cs (4)
49
IChatClient
chatClient = chatConfiguration.ChatClient;
50
IChatClient
chatClientWithToolCalling = chatClient.AsBuilder().UseFunctionInvocation().Build();
205
GetConversationWithoutToolsAsync(
IChatClient
chatClient)
218
GetConversationWithToolsAsync(
IChatClient
chatClient)
QualityEvaluatorTests.cs (4)
89
IChatClient
chatClient = scenarioRun.ChatConfiguration!.ChatClient;
129
IChatClient
chatClient = scenarioRun.ChatConfiguration!.ChatClient;
166
IChatClient
chatClient = scenarioRun.ChatConfiguration!.ChatClient;
201
IChatClient
chatClient = scenarioRun.ChatConfiguration!.ChatClient;
SafetyEvaluatorTests.cs (3)
183
IChatClient
chatClient = scenarioRun.ChatConfiguration!.ChatClient;
261
IChatClient
chatClient = scenarioRun.ChatConfiguration!.ChatClient;
588
IChatClient
chatClient = scenarioRun.ChatConfiguration!.ChatClient;
Setup.cs (1)
19
IChatClient
chatClient = azureOpenAIClient.GetChatClient(Settings.Current.DeploymentName).AsIChatClient();
Microsoft.Extensions.AI.Evaluation.Reporting (13)
ChatTurnDetails.cs (2)
34
/// for the <see cref="
IChatClient
"/>.
110
/// <see cref="
IChatClient
"/>.
ReportingConfiguration.cs (6)
36
/// Gets a <see cref="Evaluation.ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that is used by
54
/// the configured <see cref="
IChatClient
"/> and the <see cref="ChatOptions"/> that are supplied as part of
108
/// A <see cref="Evaluation.ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that is used by
212
IChatClient
originalChatClient = chatConfiguration.ChatClient;
228
IChatClient
chatClient;
265
private static IEnumerable<string> GetCachingKeysForChatClient(
IChatClient
chatClient)
ResponseCachingChatClient.cs (1)
21
IChatClient
originalChatClient,
ScenarioRun.cs (1)
89
/// Gets a <see cref="Evaluation.ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that is used by
SimpleChatClient.cs (1)
18
internal SimpleChatClient(
IChatClient
originalChatClient, ChatDetails chatDetails)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (1)
74
/// The <see cref="ChatClientMetadata"/> for the <see cref="
IChatClient
"/> that was used to communicate with the
Storage\DiskBasedReportingConfiguration.cs (1)
28
/// A <see cref="ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that is used by AI-based
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Storage\AzureStorageReportingConfiguration.cs (1)
28
/// A <see cref="ChatConfiguration"/> that specifies the <see cref="
IChatClient
"/> that is used by AI-based
Microsoft.Extensions.AI.Evaluation.Safety (10)
ContentSafetyChatClient.cs (3)
20
private readonly
IChatClient
? _originalChatClient;
25
IChatClient
? originalChatClient = null)
169
Failed to invoke '{nameof(
IChatClient
)}.{callerMemberName}()'.
ContentSafetyEvaluator.cs (2)
58
/// The <see cref="
IChatClient
"/> that should be used to communicate with the Azure AI Foundry Evaluation Service
82
IChatClient
contentSafetyServiceChatClient,
ContentSafetyServiceConfigurationExtensions.cs (3)
26
/// a new <see cref="
IChatClient
"/> that can be used both to communicate with the AI model that
62
/// The original <see cref="
IChatClient
"/>. The returned <see cref="ChatConfiguration.ChatClient"/> will be a
73
IChatClient
originalChatClient)
ProtectedMaterialEvaluator.cs (1)
76
IChatClient
chatClient = chatConfiguration.ChatClient;
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (1)
74
/// The <see cref="ChatClientMetadata"/> for the <see cref="
IChatClient
"/> that was used to communicate with the
Microsoft.Extensions.AI.Integration.Tests (19)
CallCountingChatClient.cs (1)
13
internal sealed class CallCountingChatClient(
IChatClient
innerClient) : DelegatingChatClient(innerClient)
ChatClientIntegrationTests.cs (15)
42
protected
IChatClient
? ChatClient { get; }
50
protected abstract
IChatClient
? CreateChatClient();
724
using
var
chatClient = CreateChatClient()!
763
using
var
chatClient = CreateChatClient()!
805
using
var
chatClient = CreateChatClient()!
838
using
var
chatClient = CreateChatClient()!.AsBuilder()
857
using
var
chatClient = CreateChatClient()!.AsBuilder()
879
using
var
chatClient = CreateChatClient()!
905
using
var
chatClient = CreateChatClient()!
937
var
chatClient = CreateChatClient()!.AsBuilder()
1088
var
captureOutputChatClient = ChatClient.AsBuilder()
1231
var
chatClient = ChatClient
1351
private
IChatClient
_summarizerChatClient;
1352
private
IChatClient
_innerChatClient;
1360
public TestSummarizingChatClient(
IChatClient
innerClient, int targetCount, int threshold)
PromptBasedFunctionCallingChatClient.cs (1)
31
internal sealed class PromptBasedFunctionCallingChatClient(
IChatClient
innerClient)
ReducingChatClientTests.cs (2)
19
/// <summary>Provides an example of a custom <see cref="
IChatClient
"/> for reducing chat message lists.</summary>
39
using
var
client = innerClient
Microsoft.Extensions.AI.OllamaSharp.Integration.Tests (4)
OllamaSharpChatClientIntegrationTests.cs (4)
17
protected override
IChatClient
? CreateChatClient() =>
35
using
var
chatClient = CreateChatClient()!
59
using
var
chatClient = CreateChatClient()!
107
private sealed class AssertNoToolsDefinedChatClient(
IChatClient
innerClient) : DelegatingChatClient(innerClient)
Microsoft.Extensions.AI.OpenAI (29)
MicrosoftExtensionsAIResponsesExtensions.cs (6)
103
/// The <see cref="
IChatClient
"/> returned by <see cref="OpenAIClientExtensions.AsIChatClient(OpenAIResponseClient)"/> will
118
/// The returned tool is only suitable for use with the <see cref="
IChatClient
"/> returned by
119
/// <see cref="OpenAIClientExtensions.AsIChatClient(OpenAIResponseClient)"/> (or <see cref="
IChatClient
"/>s that delegate
120
/// to such an instance). It is likely to be ignored by any other <see cref="
IChatClient
"/> implementation.
126
/// capable of being respected by any <see cref="
IChatClient
"/> implementation. This method does not attempt to
128
/// the <see cref="
IChatClient
"/> returned by <see cref="OpenAIClientExtensions.AsIChatClient(OpenAIResponseClient)"/> will
OpenAIAssistantsChatClient.cs (1)
23
/// <summary>Represents an <see cref="
IChatClient
"/> for an OpenAI <see cref="AssistantClient"/>.</summary>
OpenAIChatClient.cs (2)
26
/// <summary>Represents an <see cref="
IChatClient
"/> for an OpenAI <see cref="OpenAIClient"/> or <see cref="ChatClient"/>.</summary>
67
object?
IChatClient
.GetService(Type serviceType, object? serviceKey)
OpenAIClientExtensions.cs (18)
106
/// <summary>Gets an <see cref="
IChatClient
"/> for use with this <see cref="ChatClient"/>.</summary>
108
/// <returns>An <see cref="
IChatClient
"/> that can be used to converse via the <see cref="ChatClient"/>.</returns>
110
public static
IChatClient
AsIChatClient(this ChatClient chatClient) =>
113
/// <summary>Gets an <see cref="
IChatClient
"/> for use with this <see cref="OpenAIResponseClient"/>.</summary>
115
/// <returns>An <see cref="
IChatClient
"/> that can be used to converse via the <see cref="OpenAIResponseClient"/>.</returns>
117
public static
IChatClient
AsIChatClient(this OpenAIResponseClient responseClient) =>
120
/// <summary>Gets an <see cref="
IChatClient
"/> for use with this <see cref="AssistantClient"/>.</summary>
121
/// <param name="assistantClient">The <see cref="AssistantClient"/> instance to be accessed as an <see cref="
IChatClient
"/>.</param>
125
/// <see cref="
IChatClient
.GetResponseAsync"/> or <see cref="
IChatClient
.GetStreamingResponseAsync"/> via the <see cref="ChatOptions.ConversationId"/>
128
/// <returns>An <see cref="
IChatClient
"/> instance configured to interact with the specified agent and thread.</returns>
132
public static
IChatClient
AsIChatClient(this AssistantClient assistantClient, string assistantId, string? threadId = null) =>
135
/// <summary>Gets an <see cref="
IChatClient
"/> for use with this <see cref="AssistantClient"/>.</summary>
136
/// <param name="assistantClient">The <see cref="AssistantClient"/> instance to be accessed as an <see cref="
IChatClient
"/>.</param>
140
/// <see cref="
IChatClient
.GetResponseAsync"/> or <see cref="
IChatClient
.GetStreamingResponseAsync"/> via the <see cref="ChatOptions.ConversationId"/>
143
/// <returns>An <see cref="
IChatClient
"/> instance configured to interact with the specified agent and thread.</returns>
146
public static
IChatClient
AsIChatClient(this AssistantClient assistantClient, Assistant assistant, string? threadId = null) =>
OpenAIResponsesChatClient.cs (2)
24
/// <summary>Represents an <see cref="
IChatClient
"/> for an <see cref="OpenAIResponseClient"/>.</summary>
68
object?
IChatClient
.GetService(Type serviceType, object? serviceKey)
Microsoft.Extensions.AI.OpenAI.Tests (52)
OpenAIAssistantChatClientIntegrationTests.cs (1)
23
protected override
IChatClient
? CreateChatClient()
OpenAIAssistantChatClientTests.cs (5)
33
IChatClient
[] clients =
39
foreach (
var
chatClient in clients)
51
IChatClient
chatClient = assistantClient.AsIChatClient("assistantId");
57
using
IChatClient
pipeline = chatClient
70
Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<
IChatClient
>());
OpenAIChatClientIntegrationTests.cs (1)
8
protected override
IChatClient
? CreateChatClient() =>
OpenAIChatClientTests.cs (27)
38
IChatClient
chatClient = client.GetChatClient(model).AsIChatClient();
55
IChatClient
chatClient = openAIClient.AsIChatClient();
57
Assert.Same(chatClient, chatClient.GetService<
IChatClient
>());
63
using
IChatClient
pipeline = chatClient
76
Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<
IChatClient
>());
83
IChatClient
chatClient = openAIClient.AsIChatClient();
85
Assert.Same(chatClient, chatClient.GetService<
IChatClient
>());
88
using
IChatClient
pipeline = chatClient
101
Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<
IChatClient
>());
151
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
230
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
328
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
381
using
IChatClient
client = CreateChatClient(httpClient, modelId: "gpt-4o-mini");
458
using
IChatClient
client = CreateChatClient(httpClient, modelId: "gpt-4o-mini");
541
using
IChatClient
client = CreateChatClient(httpClient, modelId: "gpt-4o-mini");
615
using
IChatClient
client = CreateChatClient(httpClient, modelId: "gpt-4o-mini");
724
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
815
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
922
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1018
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1137
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1221
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1320
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1460
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1580
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1627
using
IChatClient
client = CreateChatClient(httpClient, "gpt-4o-mini");
1635
private static
IChatClient
CreateChatClient(HttpClient httpClient, string modelId) =>
OpenAIResponseClientIntegrationTests.cs (3)
14
protected override
IChatClient
? CreateChatClient() =>
107
using
var
client = CreateChatClient()!;
147
using
var
client = CreateChatClient()!;
OpenAIResponseClientTests.cs (15)
39
IChatClient
chatClient = client.GetOpenAIResponseClient(model).AsIChatClient();
50
IChatClient
chatClient = openAIClient.AsIChatClient();
52
Assert.Same(chatClient, chatClient.GetService<
IChatClient
>());
55
using
IChatClient
pipeline = chatClient
68
Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<
IChatClient
>());
147
using
IChatClient
client = CreateResponseClient(httpClient, "gpt-4o-mini");
290
using
IChatClient
client = CreateResponseClient(httpClient, "o4-mini");
427
using
IChatClient
client = CreateResponseClient(httpClient, "gpt-4o-mini");
528
using
IChatClient
client = CreateResponseClient(httpClient, "gpt-4o-mini");
673
using
IChatClient
client = CreateResponseClient(httpClient, modelId: "gpt-4o-mini");
801
using
IChatClient
client = CreateResponseClient(httpClient, "gpt-4o-mini");
1034
using
IChatClient
client = CreateResponseClient(httpClient, "gpt-4o-mini");
1450
using
IChatClient
client = CreateResponseClient(httpClient, "gpt-4o-mini");
1514
using
IChatClient
client = CreateResponseClient(httpClient, "gpt-4o-mini");
1522
private static
IChatClient
CreateResponseClient(HttpClient httpClient, string modelId) =>
Microsoft.Extensions.AI.Tests (63)
ChatCompletion\ChatClientBuilderTest.cs (5)
61
Assert.Throws<ArgumentNullException>("innerClient", () => new ChatClientBuilder((
IChatClient
)null!));
62
Assert.Throws<ArgumentNullException>("innerClient", () => ((
IChatClient
)null!).AsBuilder());
68
Assert.Throws<ArgumentNullException>("innerClientFactory", () => new ChatClientBuilder((Func<IServiceProvider,
IChatClient
>)null!));
99
private sealed class InnerClientCapturingChatClient(string name,
IChatClient
innerClient) : DelegatingChatClient(innerClient)
104
public new
IChatClient
InnerClient => base.InnerClient;
ChatCompletion\ConfigureOptionsChatClientTests.cs (2)
41
using
IChatClient
innerClient = new TestChatClient
58
using
var
client = innerClient
ChatCompletion\DependencyInjectionPatterns.cs (30)
26
var
instance1 = scope1.ServiceProvider.GetRequiredService<
IChatClient
>();
27
var
instance1Copy = scope1.ServiceProvider.GetRequiredService<
IChatClient
>();
28
var
instance2 = scope2.ServiceProvider.GetRequiredService<
IChatClient
>();
50
var
instance1 = scope1.ServiceProvider.GetRequiredService<
IChatClient
>();
51
var
instance1Copy = scope1.ServiceProvider.GetRequiredService<
IChatClient
>();
52
var
instance2 = scope2.ServiceProvider.GetRequiredService<
IChatClient
>();
73
Assert.Null(services.GetService<
IChatClient
>());
75
var
instance1 = scope1.ServiceProvider.GetRequiredKeyedService<
IChatClient
>("mykey");
76
var
instance1Copy = scope1.ServiceProvider.GetRequiredKeyedService<
IChatClient
>("mykey");
77
var
instance2 = scope2.ServiceProvider.GetRequiredKeyedService<
IChatClient
>("mykey");
99
Assert.Null(services.GetService<
IChatClient
>());
101
var
instance1 = scope1.ServiceProvider.GetRequiredKeyedService<
IChatClient
>("mykey");
102
var
instance1Copy = scope1.ServiceProvider.GetRequiredKeyedService<
IChatClient
>("mykey");
103
var
instance2 = scope2.ServiceProvider.GetRequiredKeyedService<
IChatClient
>("mykey");
126
Assert.Equal(typeof(
IChatClient
), sd.ServiceType);
148
Assert.Equal(typeof(
IChatClient
), sd.ServiceType);
248
public class SingletonMiddleware(
IChatClient
inner, IServiceProvider services) : DelegatingChatClient(inner)
250
public new
IChatClient
InnerClient => base.InnerClient;
ChatCompletion\DistributedCachingChatClientTest.cs (2)
122
private sealed class CustomCachingChatClient(
IChatClient
innerClient, IDistributedCache storage, Func<IEnumerable<ChatMessage>, ChatOptions?, bool> enableCaching) :
877
private sealed class CachingChatClientWithCustomKey(
IChatClient
innerClient, IDistributedCache storage)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (4)
655
IChatClient
service = configurePipeline(innerClient.AsBuilder()).Build();
733
IChatClient
service = configurePipeline(innerClient.AsBuilder()).Build();
820
IChatClient
service = configurePipeline(innerClient.AsBuilder()).Build();
884
IChatClient
service = configurePipeline(innerClient.AsBuilder()).Build();
ChatCompletion\FunctionInvokingChatClientTests.cs (3)
1004
using
IChatClient
service = innerClient.AsBuilder().UseFunctionInvocation().Build();
1243
IChatClient
service = configurePipeline(innerClient.AsBuilder()).Build(services);
1307
IChatClient
service = configurePipeline(innerClient.AsBuilder()).Build(services);
ChatCompletion\LoggingChatClientTests.cs (5)
30
Assert.Same(innerClient, innerClient.AsBuilder().UseLogging(NullLoggerFactory.Instance).Build().GetService(typeof(
IChatClient
)));
55
using
IChatClient
innerClient = new TestChatClient
63
using
IChatClient
client = innerClient
100
using
IChatClient
innerClient = new TestChatClient
112
using
IChatClient
client = innerClient
ChatCompletion\ReducingChatClientTests.cs (2)
113
using
var
client = innerClient
150
using
var
client = innerClient
ChatCompletion\UseDelegateChatClientTests.cs (10)
34
using
IChatClient
innerClient = new TestChatClient
55
using
IChatClient
client = new ChatClientBuilder(innerClient)
83
using
IChatClient
innerClient = new TestChatClient
95
using
IChatClient
client = new ChatClientBuilder(innerClient)
125
using
IChatClient
innerClient = new TestChatClient
137
using
IChatClient
client = new ChatClientBuilder(innerClient)
147
IEnumerable<ChatMessage> messages, ChatOptions? options,
IChatClient
innerClient, [EnumeratorCancellation] CancellationToken cancellationToken)
176
using
IChatClient
innerClient = new TestChatClient
197
using
IChatClient
client = new ChatClientBuilder(innerClient)
218
IEnumerable<ChatMessage> messages, ChatOptions? options,
IChatClient
innerClient, [EnumeratorCancellation] CancellationToken cancellationToken)
OpenAIEndToEnd.WebStory (1)
Components_Pages_Home_razor.g.cs (1)
201
IChatClient