getChatResponse method
Future<ChatResponse>
getChatResponse({
- required Iterable<
ChatMessage> messages, - ChatOptions? options,
- CancellationToken? cancellationToken,
override
Sends a chat request and returns the complete response.
Implementation
@override
Future<ChatResponse> getChatResponse({
required Iterable<ChatMessage> messages,
ChatOptions? options,
CancellationToken? cancellationToken,
}) async {
_logInvoked('getChatResponse');
_logInvokedSensitive('getChatResponse', messages, options);
try {
final response = await super.getChatResponse(
messages: messages,
options: options,
cancellationToken: cancellationToken,
);
_logCompleted('getChatResponse');
_logCompletedSensitive('getChatResponse', response);
return response;
} on OperationCanceledException {
_logInvocationCanceled('getChatResponse');
rethrow;
} catch (e) {
_logInvocationFailed('getChatResponse', e);
rethrow;
}
}