Sprache

RoutingChatClient.SelectClientAsync(RoutingContext, CancellationToken) Methode

Definition

Wählt den Client aus, der für die Anforderung aufgerufen werden soll.

protected:
 abstract System::Threading::Tasks::ValueTask<Microsoft::Extensions::AI::IChatClient ^> SelectClientAsync(Microsoft::Extensions::AI::RoutingContext ^ context, System::Threading::CancellationToken cancellationToken);
protected abstract System.Threading.Tasks.ValueTask<Microsoft.Extensions.AI.IChatClient> SelectClientAsync(Microsoft.Extensions.AI.RoutingContext context, System.Threading.CancellationToken cancellationToken);
abstract member SelectClientAsync : Microsoft.Extensions.AI.RoutingContext * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Extensions.AI.IChatClient>
Protected MustOverride Function SelectClientAsync (context As RoutingContext, cancellationToken As CancellationToken) As ValueTask(Of IChatClient)

Parameter

context
RoutingContext

Die anforderungsspezifischen Eingaben.

cancellationToken
CancellationToken

Das für die Anforderung bereitgestellte Abbruchtoken.

Gibt zurück

Der client, der aufgerufen werden soll.

Hinweise

Clientspezifisches Verhalten sollte im Allgemeinen an den zurückgegebenen Client angefügt werden. Das Ändern ChatOptions der Optionen für die Anforderung selbst, einschließlich späterer Aufrufe eines anderen Clients für dieselbe Anforderung. Ausnahmen von dieser Methode werden an den Aufrufer weitergegeben.

Gilt für: