///
/// HybridEmbeddingsSpec.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#if __has_include(<NitroModules/HybridObject.hpp>)
#include <NitroModules/HybridObject.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `EmbeddingsLoadOptions` to properly resolve imports.
namespace margelo::nitro::mlxreactnative { struct EmbeddingsLoadOptions; }

#include <NitroModules/Promise.hpp>
#include <string>
#include "EmbeddingsLoadOptions.hpp"
#include <optional>
#include <NitroModules/ArrayBuffer.hpp>
#include <vector>

namespace margelo::nitro::mlxreactnative {

  using namespace margelo::nitro;

  /**
   * An abstract base class for `Embeddings`
   * Inherit this class to create instances of `HybridEmbeddingsSpec` in C++.
   * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
   * @example
   * ```cpp
   * class HybridEmbeddings: public HybridEmbeddingsSpec {
   * public:
   *   HybridEmbeddings(...): HybridObject(TAG) { ... }
   *   // ...
   * };
   * ```
   */
  class HybridEmbeddingsSpec: public virtual HybridObject {
    public:
      // Constructor
      explicit HybridEmbeddingsSpec(): HybridObject(TAG) { }

      // Destructor
      ~HybridEmbeddingsSpec() override = default;

    public:
      // Properties
      virtual bool getIsLoaded() = 0;
      virtual double getDimension() = 0;
      virtual double getMaxSequenceLength() = 0;

    public:
      // Methods
      virtual std::shared_ptr<Promise<void>> load(const std::string& modelId, const std::optional<EmbeddingsLoadOptions>& options) = 0;
      virtual void unload() = 0;
      virtual std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>> embed(const std::string& text) = 0;
      virtual std::shared_ptr<Promise<std::vector<std::shared_ptr<ArrayBuffer>>>> embedBatch(const std::vector<std::string>& texts) = 0;

    protected:
      // Hybrid Setup
      void loadHybridMethods() override;

    protected:
      // Tag for logging
      static constexpr auto TAG = "Embeddings";
  };

} // namespace margelo::nitro::mlxreactnative
