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

import NitroModules

/// See ``HybridEmbeddingsSpec``
public protocol HybridEmbeddingsSpec_protocol: HybridObject {
  // Properties
  var isLoaded: Bool { get }
  var dimension: Double { get }
  var maxSequenceLength: Double { get }

  // Methods
  func load(modelId: String, options: EmbeddingsLoadOptions?) throws -> Promise<Void>
  func unload() throws -> Void
  func embed(text: String) throws -> Promise<ArrayBuffer>
  func embedBatch(texts: [String]) throws -> Promise<[ArrayBuffer]>
}

public extension HybridEmbeddingsSpec_protocol {
  /// Default implementation of ``HybridObject.toString``
  func toString() -> String {
    return "[HybridObject Embeddings]"
  }
}

/// See ``HybridEmbeddingsSpec``
open class HybridEmbeddingsSpec_base {
  private weak var cxxWrapper: HybridEmbeddingsSpec_cxx? = nil
  public init() { }
  public func getCxxWrapper() -> HybridEmbeddingsSpec_cxx {
  #if DEBUG
    guard self is any HybridEmbeddingsSpec else {
      fatalError("`self` is not a `HybridEmbeddingsSpec`! Did you accidentally inherit from `HybridEmbeddingsSpec_base` instead of `HybridEmbeddingsSpec`?")
    }
  #endif
    if let cxxWrapper = self.cxxWrapper {
      return cxxWrapper
    } else {
      let cxxWrapper = HybridEmbeddingsSpec_cxx(self as! any HybridEmbeddingsSpec)
      self.cxxWrapper = cxxWrapper
      return cxxWrapper
    }
  }
}

/**
 * A Swift base-protocol representing the Embeddings HybridObject.
 * Implement this protocol to create Swift-based instances of Embeddings.
 * ```swift
 * class HybridEmbeddings : HybridEmbeddingsSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridEmbeddingsSpec = HybridEmbeddingsSpec_protocol & HybridEmbeddingsSpec_base
