sendMessage method
Future<ChatResponse>
sendMessage(
- String message, {
- List<
ChatMessage> ? history, - Map<
String, dynamic> ? parameters,
override
Sends a single message and returns the model's reply.
Pass history to give the model prior conversation context.
Throws StateError if the provider is not initialised.
Implementation
@override
Future<ChatResponse> sendMessage(
String message, {
List<ChatMessage>? history,
Map<String, dynamic>? parameters,
}) {
checkInitialized();
return sendChatMessages([
...?history,
ChatMessage.user(message),
], parameters: parameters);
}