getChatResponseFromText method

Future<ChatResponse> getChatResponseFromText(
  1. String message, {
  2. ChatOptions? options,
  3. CancellationToken? cancellationToken,
})

Sends a single user text message and returns the response.

Implementation

Future<ChatResponse> getChatResponseFromText(
  String message, {
  ChatOptions? options,
  CancellationToken? cancellationToken,
}) =>
    getChatResponse(
      messages: [
        ChatMessage.fromText(ChatRole.user, message),
      ],
      options: options,
      cancellationToken: cancellationToken,
    );