6 implementations of IRealtimeClientSession
Microsoft.Extensions.AI (3)
Realtime\FunctionInvokingRealtimeClientSession.cs (1)
55
internal sealed class FunctionInvokingRealtimeClientSession :
IRealtimeClientSession
Realtime\LoggingRealtimeClientSession.cs (1)
29
internal sealed partial class LoggingRealtimeClientSession :
IRealtimeClientSession
Realtime\OpenTelemetryRealtimeClientSession.cs (1)
83
internal sealed partial class OpenTelemetryRealtimeClientSession :
IRealtimeClientSession
Microsoft.Extensions.AI.Abstractions.Tests (1)
TestRealtimeClientSession.cs (1)
12
public sealed class TestRealtimeClientSession :
IRealtimeClientSession
Microsoft.Extensions.AI.OpenAI (1)
OpenAIRealtimeClientSession.cs (1)
27
public sealed class OpenAIRealtimeClientSession :
IRealtimeClientSession
Microsoft.Extensions.AI.Tests (1)
parent\Microsoft.Extensions.AI.Abstractions.Tests\TestRealtimeClientSession.cs (1)
12
public sealed class TestRealtimeClientSession :
IRealtimeClientSession
122 references to IRealtimeClientSession
Microsoft.Extensions.AI (29)
Realtime\FunctionInvokingRealtimeClient.cs (4)
22
/// <see cref="
IRealtimeClientSession
"/>, they respond by invoking the corresponding <see cref="AIFunction"/> defined
57
/// in the response when calling the underlying <see cref="
IRealtimeClientSession
"/>.
125
public override async Task<
IRealtimeClientSession
> CreateSessionAsync(
128
var
innerSession = await base.CreateSessionAsync(options, cancellationToken).ConfigureAwait(false);
Realtime\FunctionInvokingRealtimeClientSession.cs (4)
30
/// <see cref="
IRealtimeClientSession
"/>, it responds by invoking the corresponding <see cref="AIFunction"/> defined
71
private readonly
IRealtimeClientSession
_innerSession;
79
/// <param name="innerSession">The underlying <see cref="
IRealtimeClientSession
"/>, or the next instance in a chain of sessions.</param>
83
public FunctionInvokingRealtimeClientSession(
IRealtimeClientSession
innerSession, FunctionInvokingRealtimeClient client, ILoggerFactory? loggerFactory = null, IServiceProvider? functionInvocationServices = null)
Realtime\LoggingRealtimeClient.cs (2)
47
public override async Task<
IRealtimeClientSession
> CreateSessionAsync(
50
var
innerSession = await base.CreateSessionAsync(options, cancellationToken).ConfigureAwait(false);
Realtime\LoggingRealtimeClientSession.cs (4)
19
/// The provided implementation of <see cref="
IRealtimeClientSession
"/> is thread-safe for concurrent use so long as the
35
private readonly
IRealtimeClientSession
_innerSession;
41
/// <param name="innerSession">The underlying <see cref="
IRealtimeClientSession
"/>.</param>
43
public LoggingRealtimeClientSession(
IRealtimeClientSession
innerSession, ILogger logger)
Realtime\OpenTelemetryRealtimeClient.cs (2)
61
public override async Task<
IRealtimeClientSession
> CreateSessionAsync(
64
var
innerSession = await base.CreateSessionAsync(options, cancellationToken).ConfigureAwait(false);
Realtime\OpenTelemetryRealtimeClientSession.cs (3)
96
private readonly
IRealtimeClientSession
_innerSession;
102
/// <param name="innerSession">The underlying <see cref="
IRealtimeClientSession
"/>.</param>
105
public OpenTelemetryRealtimeClientSession(
IRealtimeClientSession
innerSession, ILogger? logger = null, string? sourceName = null)
Realtime\RealtimeClientSessionExtensions.cs (10)
11
/// <summary>Provides a collection of static methods for extending <see cref="
IRealtimeClientSession
"/> instances.</summary>
15
/// <summary>Asks the <see cref="
IRealtimeClientSession
"/> 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="
IRealtimeClientSession
"/>,
25
public static TService? GetService<TService>(this
IRealtimeClientSession
session, object? serviceKey = null)
33
/// Asks the <see cref="
IRealtimeClientSession
"/> 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="
IRealtimeClientSession
"/>,
47
public static object GetRequiredService(this
IRealtimeClientSession
session, Type serviceType, object? serviceKey = null)
58
/// Asks the <see cref="
IRealtimeClientSession
"/> 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="
IRealtimeClientSession
"/>,
71
public static TService GetRequiredService<TService>(this
IRealtimeClientSession
session, object? serviceKey = null)
Microsoft.Extensions.AI.Abstractions (8)
Realtime\DelegatingRealtimeClient.cs (1)
44
public virtual Task<
IRealtimeClientSession
> CreateSessionAsync(
Realtime\IRealtimeClient.cs (1)
21
Task<
IRealtimeClientSession
> CreateSessionAsync(RealtimeSessionOptions? options = null, CancellationToken cancellationToken = default);
Realtime\IRealtimeClientSession.cs (2)
53
/// <summary>Asks the <see cref="
IRealtimeClientSession
"/> for an object of the specified type <paramref name="serviceType"/>.</summary>
59
/// The purpose of this method is to allow for the retrieval of strongly typed services that might be provided by the <see cref="
IRealtimeClientSession
"/>,
Realtime\RealtimeSessionOptions.cs (3)
90
/// The underlying <see cref="
IRealtimeClientSession
" /> implementation might have its own representation of options.
93
/// performing the operation. For situations where a consumer knows which concrete <see cref="
IRealtimeClientSession
" />
95
/// returned by this callback for the <see cref="
IRealtimeClientSession
" /> implementation to use, instead of creating a
Realtime\SessionUpdateRealtimeClientMessage.cs (1)
21
/// When a provider processes this message, it should update its <see cref="
IRealtimeClientSession
.Options"/>
Microsoft.Extensions.AI.OpenAI (3)
OpenAIRealtimeClient.cs (1)
55
public async Task<
IRealtimeClientSession
> CreateSessionAsync(RealtimeSessionOptions? options = null, CancellationToken cancellationToken = default)
OpenAIRealtimeClientSession.cs (2)
25
/// <summary>Represents an <see cref="
IRealtimeClientSession
"/> for the OpenAI Realtime API over WebSocket.</summary>
177
object?
IRealtimeClientSession
.GetService(Type serviceType, object? serviceKey)
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIRealtimeClientSessionTests.cs (4)
18
await using
IRealtimeClientSession
session = new OpenAIRealtimeClientSession("key", "model");
21
Assert.Same(session, session.GetService(typeof(
IRealtimeClientSession
)));
29
await using
IRealtimeClientSession
session = new OpenAIRealtimeClientSession("key", "model");
36
IRealtimeClientSession
session = new OpenAIRealtimeClientSession("key", "model");
Microsoft.Extensions.AI.Tests (78)
Realtime\FunctionInvokingRealtimeClientTests.cs (20)
75
await using
var
session = await client.CreateSessionAsync();
112
await using
var
session = await client.CreateSessionAsync();
162
await using
var
session = await client.CreateSessionAsync();
200
await using
var
session = await client.CreateSessionAsync();
240
await using
var
session = await client.CreateSessionAsync();
268
await using
var
session = await client.CreateSessionAsync();
307
await using
var
session = await client.CreateSessionAsync();
345
await using
var
session = await client.CreateSessionAsync();
363
await using
var
session = await client.CreateSessionAsync();
366
Assert.Same(session, session.GetService(typeof(
IRealtimeClientSession
)));
390
await using
var
session = await client.CreateSessionAsync();
424
await using
var
session = await client.CreateSessionAsync();
501
await using
var
session = await client.CreateSessionAsync();
543
await using
var
session = await client.CreateSessionAsync();
580
await using
var
session = await pipeline.CreateSessionAsync();
613
await using
var
session = await client.CreateSessionAsync();
632
private static FunctionInvokingRealtimeClient CreateClient(
IRealtimeClientSession
? session = null)
668
private readonly
IRealtimeClientSession
_session;
670
public TestRealtimeClient(
IRealtimeClientSession
session)
675
public Task<
IRealtimeClientSession
> CreateSessionAsync(RealtimeSessionOptions? options = null, CancellationToken cancellationToken = default)
Realtime\LoggingRealtimeClientTests.cs (20)
35
await using
var
s1 = await pipeline1.CreateSessionAsync();
37
Assert.Same(innerSession, s1.GetService(typeof(
IRealtimeClientSession
)));
42
await using
var
s2 = await pipeline2.CreateSessionAsync();
50
await using
var
s3 = await pipeline3.CreateSessionAsync();
54
await using
var
s4 = await pipeline4.CreateSessionAsync();
58
await using
var
s5 = await pipeline5.CreateSessionAsync();
81
await using
var
session = await client.CreateSessionAsync();
126
await using
var
session = await client.CreateSessionAsync();
175
await using
var
session = await client.CreateSessionAsync();
226
await using
var
session = await client.CreateSessionAsync();
256
await using
var
session = await client.CreateSessionAsync();
293
await using
var
session = await client.CreateSessionAsync();
335
await using
var
session = await client.CreateSessionAsync();
363
await using
var
session = await client.CreateSessionAsync();
366
Assert.Same(session, session.GetService(typeof(
IRealtimeClientSession
)));
390
await using
var
session = await client.CreateSessionAsync();
421
await using
var
session = await client.CreateSessionAsync();
464
private readonly
IRealtimeClientSession
_session;
466
public TestRealtimeClient(
IRealtimeClientSession
session)
471
public Task<
IRealtimeClientSession
> CreateSessionAsync(RealtimeSessionOptions? options = null, CancellationToken cancellationToken = default)
Realtime\OpenTelemetryRealtimeClientTests.cs (25)
84
await using
var
session = await client.CreateSessionAsync();
227
await using
var
session = await client.CreateSessionAsync();
284
await using
var
session = await client.CreateSessionAsync();
332
await using
var
session = await client.CreateSessionAsync();
368
await using
var
session = await client.CreateSessionAsync();
384
await using
var
session = await client.CreateSessionAsync();
385
Assert.Same(session, session.GetService(typeof(
IRealtimeClientSession
)));
425
await using
var
session = await client.CreateSessionAsync();
462
await using
var
session = await client.CreateSessionAsync();
505
await using
var
session = await client.CreateSessionAsync();
548
await using
var
session = await client.CreateSessionAsync();
633
await using
var
session = await client.CreateSessionAsync();
676
await using
var
session = await client.CreateSessionAsync();
719
await using
var
session = await client.CreateSessionAsync();
761
await using
var
session = await client.CreateSessionAsync();
803
await using
var
session = await client.CreateSessionAsync();
844
await using
var
session = await client.CreateSessionAsync();
885
await using
var
session = await client.CreateSessionAsync();
926
await using
var
session = await client.CreateSessionAsync();
967
await using
var
session = await client.CreateSessionAsync();
1081
await using
var
session = await pipeline.CreateSessionAsync();
1097
var
session = await client.CreateSessionAsync();
1108
private readonly
IRealtimeClientSession
_session;
1110
public TestRealtimeClient(
IRealtimeClientSession
session)
1115
public Task<
IRealtimeClientSession
> CreateSessionAsync(RealtimeSessionOptions? options = null, CancellationToken cancellationToken = default)
Realtime\RealtimeClientBuilderTests.cs (3)
145
public Task<
IRealtimeClientSession
> CreateSessionAsync(RealtimeSessionOptions? options = null, CancellationToken cancellationToken = default)
146
=> Task.FromResult<
IRealtimeClientSession
>(new TestRealtimeClientSession());
170
public override async Task<
IRealtimeClientSession
> CreateSessionAsync(
Realtime\RealtimeClientExtensionsTests.cs (2)
114
public Task<
IRealtimeClientSession
> CreateSessionAsync(RealtimeSessionOptions? options = null, CancellationToken cancellationToken = default)
115
=> Task.FromResult<
IRealtimeClientSession
>(new TestRealtimeClientSession());
Realtime\RealtimeClientSessionExtensionsTests.cs (8)
17
Assert.Throws<ArgumentNullException>("session", () => ((
IRealtimeClientSession
)null!).GetService<
IRealtimeClientSession
>());
48
var
result = session.GetService<
IRealtimeClientSession
>();
55
Assert.Throws<ArgumentNullException>("session", () => ((
IRealtimeClientSession
)null!).GetRequiredService(typeof(string)));
56
Assert.Throws<ArgumentNullException>("session", () => ((
IRealtimeClientSession
)null!).GetRequiredService<string>());
78
var
result = session.GetRequiredService<
IRealtimeClientSession
>();