7 implementations of IRealtimeClient
Microsoft.Extensions.AI.Abstractions (1)
Realtime\DelegatingRealtimeClient.cs (1)
21public class DelegatingRealtimeClient : IRealtimeClient
Microsoft.Extensions.AI.OpenAI (1)
OpenAIRealtimeClient.cs (1)
19public sealed class OpenAIRealtimeClient : IRealtimeClient
Microsoft.Extensions.AI.Tests (5)
Realtime\FunctionInvokingRealtimeClientTests.cs (1)
666private sealed class TestRealtimeClient : IRealtimeClient
Realtime\LoggingRealtimeClientTests.cs (1)
462private sealed class TestRealtimeClient : IRealtimeClient
Realtime\OpenTelemetryRealtimeClientTests.cs (1)
1106private sealed class TestRealtimeClient : IRealtimeClient
Realtime\RealtimeClientBuilderTests.cs (1)
143private sealed class TestRealtimeClient : IRealtimeClient
Realtime\RealtimeClientExtensionsTests.cs (1)
112private sealed class TestRealtimeClient : IRealtimeClient
92 references to IRealtimeClient
Microsoft.Extensions.AI (38)
Realtime\FunctionInvokingRealtimeClient.cs (2)
37/// <param name="innerClient">The inner <see cref="IRealtimeClient"/>.</param> 40public FunctionInvokingRealtimeClient(IRealtimeClient innerClient, ILoggerFactory? loggerFactory = null, IServiceProvider? functionInvocationServices = null)
Realtime\LoggingRealtimeClient.cs (2)
30/// <param name="innerClient">The inner <see cref="IRealtimeClient"/>.</param> 32public LoggingRealtimeClient(IRealtimeClient innerClient, ILogger logger)
Realtime\LoggingRealtimeClientBuilderExtensions.cs (1)
14/// <summary>Provides extensions for configuring logging on an <see cref="IRealtimeClient"/> pipeline.</summary>
Realtime\OpenTelemetryRealtimeClient.cs (2)
31/// <param name="innerClient">The inner <see cref="IRealtimeClient"/>.</param> 34public OpenTelemetryRealtimeClient(IRealtimeClient innerClient, ILogger? logger = null, string? sourceName = null)
Realtime\OpenTelemetryRealtimeClientBuilderExtensions.cs (1)
13/// <summary>Provides extensions for configuring OpenTelemetry on an <see cref="IRealtimeClient"/> pipeline.</summary>
Realtime\RealtimeClientBuilder.cs (18)
12/// <summary>A builder for creating pipelines of <see cref="IRealtimeClient"/>.</summary> 16private readonly Func<IServiceProvider, IRealtimeClient> _innerClientFactory; 19private List<Func<IRealtimeClient, IServiceProvider, IRealtimeClient>>? _clientFactories; 22/// <param name="innerClient">The inner <see cref="IRealtimeClient"/> that represents the underlying backend.</param> 24public RealtimeClientBuilder(IRealtimeClient innerClient) 31/// <param name="innerClientFactory">A callback that produces the inner <see cref="IRealtimeClient"/> that represents the underlying backend.</param> 32public RealtimeClientBuilder(Func<IServiceProvider, IRealtimeClient> innerClientFactory) 37/// <summary>Builds an <see cref="IRealtimeClient"/> that represents the entire pipeline. Calls to this instance will pass through each of the pipeline stages in turn.</summary> 39/// The <see cref="IServiceProvider"/> that should provide services to the <see cref="IRealtimeClient"/> instances. 42/// <returns>An instance of <see cref="IRealtimeClient"/> that represents the entire pipeline.</returns> 43public IRealtimeClient Build(IServiceProvider? services = null) 46var client = _innerClientFactory(services); 58$"Ensure that the callbacks passed to {nameof(Use)} return non-null {nameof(IRealtimeClient)} instances."); 70public RealtimeClientBuilder Use(Func<IRealtimeClient, IRealtimeClient> clientFactory) 81public RealtimeClientBuilder Use(Func<IRealtimeClient, IServiceProvider, IRealtimeClient> clientFactory)
Realtime\RealtimeClientBuilderRealtimeClientExtensions.cs (2)
11/// <summary>Provides extension methods for working with <see cref="IRealtimeClient"/> in the context of <see cref="RealtimeClientBuilder"/>.</summary> 23public static RealtimeClientBuilder AsBuilder(this IRealtimeClient innerClient)
Realtime\RealtimeClientExtensions.cs (10)
11/// <summary>Provides a collection of static methods for extending <see cref="IRealtimeClient"/> instances.</summary> 15/// <summary>Asks the <see cref="IRealtimeClient"/> 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="IRealtimeClient"/>, 25public static TService? GetService<TService>(this IRealtimeClient client, object? serviceKey = null) 33/// Asks the <see cref="IRealtimeClient"/> 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="IRealtimeClient"/>, 47public static object GetRequiredService(this IRealtimeClient client, Type serviceType, object? serviceKey = null) 58/// Asks the <see cref="IRealtimeClient"/> 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="IRealtimeClient"/>, 71public static TService GetRequiredService<TService>(this IRealtimeClient client, object? serviceKey = null)
Microsoft.Extensions.AI.Abstractions (7)
Realtime\DelegatingRealtimeClient.cs (5)
14/// Provides an optional base class for an <see cref="IRealtimeClient"/> that passes through calls to another instance. 17/// This is recommended as a base type when building clients that can be chained around an underlying <see cref="IRealtimeClient"/>. 28protected DelegatingRealtimeClient(IRealtimeClient innerClient) 40/// <summary>Gets the inner <see cref="IRealtimeClient" />.</summary> 41protected IRealtimeClient InnerClient { get; }
Realtime\IRealtimeClient.cs (2)
23/// <summary>Asks the <see cref="IRealtimeClient"/> for an object of the specified type <paramref name="serviceType"/>.</summary> 29/// The purpose of this method is to allow for the retrieval of strongly typed services that might be provided by the <see cref="IRealtimeClient"/>,
Microsoft.Extensions.AI.OpenAI (2)
OpenAIRealtimeClient.cs (2)
17/// <summary>Represents an <see cref="IRealtimeClient"/> for the OpenAI Realtime API.</summary> 79object? IRealtimeClient.GetService(Type serviceType, object? serviceKey)
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIRealtimeClientTests.cs (4)
25using IRealtimeClient client = new OpenAIRealtimeClient("key", "model"); 28Assert.Same(client, client.GetService(typeof(IRealtimeClient))); 36using IRealtimeClient client = new OpenAIRealtimeClient("key", "model"); 43IRealtimeClient client = new OpenAIRealtimeClient("key", "model");
Microsoft.Extensions.AI.Tests (41)
Realtime\FunctionInvokingRealtimeClientTests.cs (1)
577using var pipeline = builder.Build();
Realtime\LoggingRealtimeClientTests.cs (15)
34using var pipeline1 = c1.AsBuilder().UseLogging(NullLoggerFactory.Instance).Build(); 41using var pipeline2 = c2.AsBuilder().UseLogging(factory).Build(); 49using var pipeline3 = c3.AsBuilder().UseLogging().Build(services); 53using var pipeline4 = c4.AsBuilder().UseLogging(null).Build(services); 57using var pipeline5 = c5.AsBuilder().UseLogging(NullLoggerFactory.Instance).Build(services); 77using var client = innerClient 122using var client = innerClient 171using var client = innerClient 222using var client = innerClient 252using var client = innerClient 289using var client = innerClient 331using var client = innerClient 359using var client = innerClient 386using var client = innerClient 417using var client = innerClient
Realtime\OpenTelemetryRealtimeClientTests.cs (5)
223using var client = innerClient 280using var client = innerClient 328using var client = innerClient 421using var client = innerClient 1080using var pipeline = builder.Build();
Realtime\RealtimeClientBuilderTests.cs (12)
19Assert.Throws<ArgumentNullException>("innerClient", () => new RealtimeClientBuilder((IRealtimeClient)null!)); 25Assert.Throws<ArgumentNullException>("innerClientFactory", () => new RealtimeClientBuilder((Func<IServiceProvider, IRealtimeClient>)null!)); 34var result = builder.Build(); 44var result = builder.Build(); 54Assert.Throws<ArgumentNullException>("clientFactory", () => builder.Use((Func<IRealtimeClient, IRealtimeClient>)null!)); 55Assert.Throws<ArgumentNullException>("clientFactory", () => builder.Use((Func<IRealtimeClient, IServiceProvider, IRealtimeClient>)null!)); 68using var pipeline = builder.Build(); 130Assert.Throws<ArgumentNullException>("innerClient", () => ((IRealtimeClient)null!).AsBuilder()); 161public OrderTrackingClient(IRealtimeClient inner, string name, List<string> callOrder) 168public IRealtimeClient GetInner() => InnerClient;
Realtime\RealtimeClientExtensionsTests.cs (8)
18Assert.Throws<ArgumentNullException>("client", () => ((IRealtimeClient)null!).GetService<IRealtimeClient>()); 49var result = client.GetService<IRealtimeClient>(); 56Assert.Throws<ArgumentNullException>("client", () => ((IRealtimeClient)null!).GetRequiredService(typeof(string))); 57Assert.Throws<ArgumentNullException>("client", () => ((IRealtimeClient)null!).GetRequiredService<string>()); 79var result = client.GetRequiredService<IRealtimeClient>();