createRawEmbedding method

Future<Map<String, dynamic>> createRawEmbedding({
  1. required String prompt,
})

Creates an embedding vector representing the input text. returns it in Map

Implementation

Future<Map<String, dynamic>> createRawEmbedding(
    {required String prompt}) async {
  try {
    _checkApi(values: [prompt]);

    final map = {'model': _configEmbedding.model, 'input': prompt};
    final result =
        await service.createEmbedding(apiKey: _apiKey, promptWithModel: map);
    return result.toMap();
  } catch (e) {
    throw _exceptionCheck(e);
  }
}