OrderedFailoverChatClient Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides ordered failover across a sequence of chat clients.
public ref class OrderedFailoverChatClient sealed : Microsoft::Extensions::AI::FailoverChatClient
[System.Diagnostics.CodeAnalysis.Experimental("MEAI001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")]
public sealed class OrderedFailoverChatClient : Microsoft.Extensions.AI.FailoverChatClient
[<System.Diagnostics.CodeAnalysis.Experimental("MEAI001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")>]
type OrderedFailoverChatClient = class
inherit FailoverChatClient
Public NotInheritable Class OrderedFailoverChatClient
Inherits FailoverChatClient
- Inheritance
- Attributes
Remarks
The clients are tried in order. An invocation failure before streaming output is exposed advances to the next client. Cancellation and failures after streaming output is exposed are propagated without failover.
The configured clients are snapshotted by the constructor. The same client may appear more than once, in which case it is invoked once per position. When every client has failed, the final failure is rethrown.
Constructors
| Name | Description |
|---|---|
| OrderedFailoverChatClient(IReadOnlyList<IChatClient>, Boolean) |
Initializes a new instance of the OrderedFailoverChatClient class. |
Properties
| Name | Description |
|---|---|
| MaximumAttemptsPerRequest |
Gets or sets the maximum number of client invocations permitted for one request. (Inherited from FailoverChatClient) |
Methods
| Name | Description |
|---|---|
| Dispose() |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from RoutingChatClient) |
| Dispose(Boolean) |
Provides a mechanism for releasing resources owned by the derived instance. (Inherited from RoutingChatClient) |
| GetResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken) | (Inherited from FailoverChatClient) |
| GetService(Type, Object) |
Asks the IChatClient for an object of the specified type |
| GetStreamingResponseAsync(IEnumerable<ChatMessage>, ChatOptions, CancellationToken) | (Inherited from FailoverChatClient) |
| OnRoutingUpdateAsync(RoutingContext, FailoverChatClientAttempt, Boolean, CancellationToken) |
Invoked after a client invocation completes, fails, or is abandoned. (Inherited from FailoverChatClient) |
| SelectClientAsync(RoutingContext, CancellationToken) |
Selects the client to invoke for the request. (Inherited from RoutingChatClient) |