embedText method

  1. @override
Future<EmbedTextResponse> embedText(
  1. EmbedTextRequest request
)
override

Generates an embedding from the model given an input message.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

@override
Future<EmbedTextResponse> embedText(EmbedTextRequest request) async {
  if (isClosed) throw StateError('Service is closed');

  if (_embedText case final embedText?) {
    return embedText(request);
  }
  throw UnsupportedError('embedText');
}