createEmbedding method

Future<EmbeddingsResponse> createEmbedding({
  1. required String apiKey,
  2. required Map<String, dynamic> promptWithModel,
})

Create Embeddings

Implementation

Future<EmbeddingsResponse> createEmbedding(
    {required String apiKey,
    required Map<String, dynamic> promptWithModel}) async {
  final response = await dio.post(UrlBuilder.embeddingsPath,
      data: promptWithModel,
      options: Options(headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer $apiKey'
      }));
  return EmbeddingsResponse.fromMap(response.data);
}