Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
4c04354
Realtime Client Proposal
Feb 10, 2026
d6d6671
Replace [Experimental("MEAI001")] with DiagnosticIds.Experiments.AIRe…
Feb 11, 2026
07947cc
Apply suggestions from code review
tarekgh Feb 11, 2026
f2fe352
Remove AsIRealtimeClient extension method
Feb 11, 2026
4f9f05d
Address PR review comments
Feb 11, 2026
ff14b19
Fix multiple issues found during code review
Feb 11, 2026
770fa28
Remove duplicate internal FunctionInvocationStatus enum
Feb 12, 2026
3cbb1d2
Remove stale CreateToolsMap calls before the loop
Feb 12, 2026
5511b8d
Remove FunctionInvocationResultInternal; use public FunctionInvocatio…
Feb 12, 2026
fbdc7cb
Add IAsyncDisposable to IRealtimeSession; store and await receive tas…
Feb 12, 2026
f33e790
Revert API baseline JSON changes
Feb 12, 2026
7dad147
Clarify audio/text token counts are subsets of Input/OutputTokenCount
Feb 12, 2026
d66e6fe
Replace ToolChoiceMode enum with ChatToolMode for cross-modality cons…
Feb 13, 2026
fc5341e
Unify TranscriptionOptions across Realtime and SpeechToText
Feb 13, 2026
77449ba
Use HasTopLevelMediaType instead of StartsWith for audio check
Feb 13, 2026
f7fe2ef
Add API compat suppressions for SpeechToTextOptions breaking changes
Feb 14, 2026
a6b4ccd
Replace string Eagerness with SemanticEagerness struct (ChatRole patt…
Feb 14, 2026
03d7648
Remove InternalsVisibleToTest from Microsoft.Extensions.AI.OpenAI
Feb 22, 2026
5845991
Add RawRepresentationFactory to RealtimeSessionOptions
Feb 22, 2026
63531b5
Remove OpenAI-specific tracing properties from RealtimeSessionOptions
Feb 22, 2026
f333eaa
Remove AIFunction/HostedMcpServerTool properties, use ChatToolMode
Feb 22, 2026
4a6947e
Improve XML docs for Usage on response and transcription messages
Feb 22, 2026
29bbdca
Remove leftover temp files
Feb 22, 2026
ab0e74d
Improve ConversationId XML docs on RealtimeServerResponseCreatedMessage
Feb 22, 2026
39a042d
Split Text/Audio properties on RealtimeServerOutputTextAudioMessage
Feb 22, 2026
46ae23d
Replace RealtimeServerMessageType enum with readonly struct
Feb 22, 2026
156b376
Move Parameter into ErrorContent.Details on error messages
Feb 22, 2026
f59afd6
Add RawRepresentation property to RealtimeContentItem
Feb 22, 2026
e8393c1
Rename Metadata to AdditionalProperties for consistency
Feb 22, 2026
6aae7d3
Improve MaxOutputTokens XML docs to clarify modality scope
Feb 22, 2026
c7f041b
Improve XML docs on RealtimeClientResponseCreateMessage properties
Feb 22, 2026
cde880a
Improve RealtimeClientResponseCreateMessage class-level XML doc
Feb 22, 2026
d2516c2
Rename EventId to MessageId for terminology consistency
Feb 22, 2026
1d15400
Remove blank line between using directives in audio buffer messages
Feb 22, 2026
0ca0a17
Rename RealtimeAudioFormat.Type to MediaType for consistency
Feb 23, 2026
03014ce
Refactor IRealtimeSession: rename InjectClientMessageAsync to SendCli…
Feb 23, 2026
02fd006
Make RealtimeSessionOptions and related types immutable with init-onl…
Feb 23, 2026
aa17989
Fix XML doc param order, add null validation to constructors
Feb 23, 2026
e24108b
Merge branch 'main' into RealtimeClientProposal
tarekgh Mar 3, 2026
c7dbcf8
OpenAI Realtime Provider using OpenAI SDK
Mar 3, 2026
756fd75
Fix typo: add missing space in comment ('IDsince' -> 'ID since')
Mar 3, 2026
5c61540
Make CreateSessionAsync return non-nullable IRealtimeSession
Mar 3, 2026
82e0b4c
Remove SemanticEagerness from Abstractions; move eagerness to Additio…
Mar 4, 2026
dfb684a
Include CompatibilitySuppressions for SpeechToTextOptions API changes
Mar 4, 2026
faa6cfb
Remove MCP-specific types from abstractions; add provider contract docs
Mar 4, 2026
1be4dba
Remove trailing blank line in RealtimeServerErrorMessage
Mar 4, 2026
381dc44
Clarify ErrorMessageId XML doc to distinguish from base MessageId
Mar 4, 2026
e186ab8
Rename ErrorMessageId to OriginatingMessageId for clarity
Mar 4, 2026
f752d83
Change ExcludeFromConversation from bool to bool? for provider-defaul…
Mar 4, 2026
8a6754d
Remove blank lines between Experimental attribute and class declaration
Mar 4, 2026
7c5eeb2
Add null validation to Content property setter
Mar 4, 2026
d8e8e5f
Make RealtimeAudioFormat.SampleRate non-nullable and remove misleadin…
Mar 4, 2026
621d49d
Rename IRealtimeSession to IRealtimeClientSession and SendClientMessa…
Mar 4, 2026
6d50fec
Fix null DefaultConversationConfiguration when ExcludeFromConversatio…
Mar 4, 2026
7269c15
Remove IDisposable from IRealtimeClientSession, keep only IAsyncDispo…
Mar 5, 2026
8843a12
Remove ConversationId from RealtimeServerResponseCreatedMessage
Mar 5, 2026
f372c42
Rename ResponseCreateMessage and ConversationItemCreateMessage to Cre…
Mar 5, 2026
0c8fe65
Rename RealtimeContentItem to RealtimeConversationItem
Mar 5, 2026
df8d2c0
Remove VoiceSpeed from RealtimeSessionOptions and use RawRepresentati…
Mar 5, 2026
0e9c3b8
Remove UpdateAsync from IRealtimeClientSession, use message-based app…
Mar 5, 2026
5ffae0c
Rename realtime session classes to include Client in name
Mar 5, 2026
ddd058b
Simplify DisposeAsyncCore to return ValueTask directly
Mar 5, 2026
0161bf7
Convert RealtimeSessionKind from enum to extensible string struct
Mar 5, 2026
d16fa7c
Remove NoiseReductionOptions from abstraction
Mar 5, 2026
a2dd558
Remove VoiceActivityDetection hierarchy from abstraction
Mar 5, 2026
0f160d2
Remove AnonymousDelegatingRealtimeClientSession and anonymous Use ove…
Mar 6, 2026
2f4a0b2
Fix JSON injection in MessageId by using JsonSerializer.Serialize
Mar 6, 2026
50a773c
Remove meaningless duration metric from SendAsync in OTel session
Mar 6, 2026
5932110
Refactor builder to operate on IRealtimeClient instead of IRealtimeCl…
Mar 6, 2026
39ad4b0
Rename message classes: move RealtimeClient/RealtimeServer before Mes…
Mar 6, 2026
1013c1d
Merge branch 'upstream-main' into RealtimeClientProposal
Mar 6, 2026
b8d5741
Fix cancellation tests to also accept WebSocketException on net462
Mar 6, 2026
51213de
Remove PreviousId from CreateConversationItemRealtimeClientMessage as…
Mar 7, 2026
056f19b
Document that ResponseId may be null and response lifecycle events ma…
Mar 7, 2026
2075355
Document that CreateResponseRealtimeClientMessage may be a no-op for …
Mar 7, 2026
712eb7e
Add RealtimeResponseStatus constants and document interruption/barge-…
Mar 7, 2026
046a71b
Remove session parameter from RealtimeSessionOptions.RawRepresentatio…
Mar 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -805,4 +805,144 @@
<Right>lib/netstandard2.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.get_ModelId</Target>
<Left>lib/net10.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net10.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.get_SpeechLanguage</Target>
<Left>lib/net10.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net10.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.set_ModelId(System.String)</Target>
<Left>lib/net10.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net10.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.set_SpeechLanguage(System.String)</Target>
<Left>lib/net10.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net10.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.get_ModelId</Target>
<Left>lib/net462/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net462/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.get_SpeechLanguage</Target>
<Left>lib/net462/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net462/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.set_ModelId(System.String)</Target>
<Left>lib/net462/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net462/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.set_SpeechLanguage(System.String)</Target>
<Left>lib/net462/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net462/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.get_ModelId</Target>
<Left>lib/net8.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net8.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.get_SpeechLanguage</Target>
<Left>lib/net8.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net8.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.set_ModelId(System.String)</Target>
<Left>lib/net8.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net8.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.set_SpeechLanguage(System.String)</Target>
<Left>lib/net8.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net8.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.get_ModelId</Target>
<Left>lib/net9.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net9.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.get_SpeechLanguage</Target>
<Left>lib/net9.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net9.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.set_ModelId(System.String)</Target>
<Left>lib/net9.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net9.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.set_SpeechLanguage(System.String)</Target>
<Left>lib/net9.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/net9.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.get_ModelId</Target>
<Left>lib/netstandard2.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/netstandard2.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.get_SpeechLanguage</Target>
<Left>lib/netstandard2.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/netstandard2.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.set_ModelId(System.String)</Target>
<Left>lib/netstandard2.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/netstandard2.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Extensions.AI.SpeechToTextOptions.set_SpeechLanguage(System.String)</Target>
<Left>lib/netstandard2.0/Microsoft.Extensions.AI.Abstractions.dll</Left>
<Right>lib/netstandard2.0/Microsoft.Extensions.AI.Abstractions.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
</Suppressions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics.CodeAnalysis;
using Microsoft.Shared.DiagnosticIds;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.Extensions.AI;

/// <summary>
/// Represents a real-time message for creating a conversation item.
/// </summary>
[Experimental(DiagnosticIds.Experiments.AIRealTime, UrlFormat = DiagnosticIds.UrlFormat)]
public class CreateConversationItemRealtimeClientMessage : RealtimeClientMessage
{
/// <summary>
/// Initializes a new instance of the <see cref="CreateConversationItemRealtimeClientMessage"/> class.
/// </summary>
/// <param name="item">The conversation item to create.</param>
public CreateConversationItemRealtimeClientMessage(RealtimeConversationItem item)
{
Item = Throw.IfNull(item);
}

/// <summary>
/// Gets or sets the conversation item to create.
/// </summary>
public RealtimeConversationItem Item { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Shared.DiagnosticIds;

namespace Microsoft.Extensions.AI;

/// <summary>
/// Represents a client message that triggers model inference to generate a response.
/// </summary>
/// <remarks>
/// <para>
/// Sending this message instructs the provider to generate a new response from the model.
/// The response may include one or more output items (text, audio, or tool calls).
/// Properties on this message optionally override the session-level configuration
/// for this response only.
/// </para>
/// <para>
/// Not all providers support explicit response triggering. Voice-activity-detection (VAD) driven
/// providers may respond automatically when speech is detected or input is committed, in which case
/// this message may be treated as a no-op. Per-response overrides (instructions, tools, voice, etc.)
/// are advisory and may be silently ignored by providers that do not support them.
/// </para>
/// </remarks>
[Experimental(DiagnosticIds.Experiments.AIRealTime, UrlFormat = DiagnosticIds.UrlFormat)]
public class CreateResponseRealtimeClientMessage : RealtimeClientMessage
{
/// <summary>
/// Initializes a new instance of the <see cref="CreateResponseRealtimeClientMessage"/> class.
/// </summary>
public CreateResponseRealtimeClientMessage()
{
}

/// <summary>
/// Gets or sets the list of the conversation items to create a response for.
/// </summary>
public IList<RealtimeConversationItem>? Items { get; set; }

/// <summary>
/// Gets or sets the output audio options for the response.
/// </summary>
/// <remarks>
/// If set, overrides the session-level audio output configuration for this response only.
/// If <see langword="null"/>, the session's default audio options are used.
/// </remarks>
public RealtimeAudioFormat? OutputAudioOptions { get; set; }

/// <summary>
/// Gets or sets the voice of the output audio.
/// </summary>
/// <remarks>
/// If set, overrides the session-level voice for this response only.
/// If <see langword="null"/>, the session's default voice is used.
/// </remarks>
public string? OutputVoice { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the response output should be excluded from the conversation context.
/// </summary>
/// <remarks>
/// When <see langword="true"/>, the response is generated out-of-band: the model produces output
/// but the resulting items are not added to the conversation history, so they will not appear
/// as context for subsequent responses.
/// If <see langword="null"/>, the provider's default behavior is used.
/// </remarks>
public bool? ExcludeFromConversation { get; set; }

/// <summary>
/// Gets or sets the instructions that guide the model on desired responses.
/// </summary>
/// <remarks>
/// If set, overrides the session-level instructions for this response only.
/// If <see langword="null"/>, the session's default instructions are used.
/// </remarks>
public string? Instructions { get; set; }

/// <summary>
/// Gets or sets the maximum number of output tokens for the response, inclusive of all modalities and tool calls.
/// </summary>
/// <remarks>
/// This limit applies to the total output tokens regardless of modality (text, audio, etc.).
/// If <see langword="null"/>, the provider's default limit is used.
/// </remarks>
public int? MaxOutputTokens { get; set; }

/// <summary>
/// Gets or sets any additional properties associated with the response request.
/// </summary>
/// <remarks>
/// This can be used to attach arbitrary key-value metadata to a response request
/// for tracking or disambiguation purposes (e.g., correlating multiple simultaneous responses).
/// Providers may map this to their own metadata fields.
/// </remarks>
public AdditionalPropertiesDictionary? AdditionalProperties { get; set; }

/// <summary>
/// Gets or sets the output modalities for the response (e.g., "text", "audio").
/// </summary>
/// <remarks>
/// If set, overrides the session-level output modalities for this response only.
/// If <see langword="null"/>, the session's default modalities are used.
/// </remarks>
public IList<string>? OutputModalities { get; set; }

/// <summary>
/// Gets or sets the tool choice mode for the response.
/// </summary>
/// <remarks>
/// If set, overrides the session-level tool choice for this response only.
/// If <see langword="null"/>, the session's default tool choice is used.
/// </remarks>
public ChatToolMode? ToolMode { get; set; }

/// <summary>
/// Gets or sets the AI tools available for generating the response.
/// </summary>
/// <remarks>
/// If set, overrides the session-level tools for this response only.
/// If <see langword="null"/>, the session's default tools are used.
/// </remarks>
public IList<AITool>? Tools { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Shared.DiagnosticIds;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.Extensions.AI;

/// <summary>
/// Provides an optional base class for an <see cref="IRealtimeClient"/> that passes through calls to another instance.
/// </summary>
/// <remarks>
/// This is recommended as a base type when building clients that can be chained around an underlying <see cref="IRealtimeClient"/>.
/// The default implementation simply passes each call to the inner client instance.
/// </remarks>
[Experimental(DiagnosticIds.Experiments.AIRealTime, UrlFormat = DiagnosticIds.UrlFormat)]
public class DelegatingRealtimeClient : IRealtimeClient
{
/// <summary>
/// Initializes a new instance of the <see cref="DelegatingRealtimeClient"/> class.
/// </summary>
/// <param name="innerClient">The wrapped client instance.</param>
/// <exception cref="ArgumentNullException"><paramref name="innerClient"/> is <see langword="null"/>.</exception>
protected DelegatingRealtimeClient(IRealtimeClient innerClient)
{
InnerClient = Throw.IfNull(innerClient);
}

/// <inheritdoc />
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}

/// <summary>Gets the inner <see cref="IRealtimeClient" />.</summary>
protected IRealtimeClient InnerClient { get; }

/// <inheritdoc />
public virtual Task<IRealtimeClientSession> CreateSessionAsync(
RealtimeSessionOptions? options = null, CancellationToken cancellationToken = default) =>
InnerClient.CreateSessionAsync(options, cancellationToken);

/// <inheritdoc />
public virtual object? GetService(Type serviceType, object? serviceKey = null)
{
_ = Throw.IfNull(serviceType);

// If the key is non-null, we don't know what it means so pass through to the inner service.
return
serviceKey is null && serviceType.IsInstanceOfType(this) ? this :
InnerClient.GetService(serviceType, serviceKey);
}

/// <summary>Provides a mechanism for releasing unmanaged resources.</summary>
/// <param name="disposing"><see langword="true"/> if being called from <see cref="Dispose()"/>; otherwise, <see langword="false"/>.</param>
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
InnerClient.Dispose();
}
}
}
Loading
Loading