INNER CODE UNIT · Dart

Embedding

redevrx/chat_gpt_sdk · lib/src/embedding.dart:8

class Embedding {
  final OpenAIClient _client;

  Embedding(this._client);

  ///Get a vector representation of a given input
  /// that can be easily consumed by machine learning
  /// models and algorithms.[embedding]
  ///
  Future<EmbedResponse> embedding(
    EmbedRequest request, {
    void Function(CancelData cancelData)? onCancel,
  }) {
    return _client.post(
      _client.apiUrl + kEmbedding,
      request.toJson(),
      onCancel: (it) => onCancel != null ? onCancel(it) : null,
      onSuccess: (it) => EmbedResponse.fromJson(it),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…