React Native RAG - v0.10.0
    Preparing search index...

    ExecuTorch-based implementation of Embeddings for React Native.

    Implements

    Index

    Constructors

    Methods

    Constructors

    • Creates a new ExecuTorch embeddings instance.

      Parameters

      • params: ExecuTorchEmbeddingsParams

        Parameters for the instance.

        • modelPath

          Path or URL of the embedding model.

        • tokenizerPath

          Path or URL of the tokenizer.

        • defaultPrompt

          Prompt prepended to inputs without a more specific prompt.

        • documentPrompt

          Prompt prepended to documents being indexed.

        • queryPrompt

          Prompt prepended to search queries.

        • onDownloadProgress

          Download progress callback (0-1).

      Returns ExecuTorchEmbeddings

    Methods

    • Generates an embedding vector for the given text.

      Parameters

      • text: string

        Input string to embed.

      • Optionaloptions: EmbedOptions

        Whether text is a document or a query, which selects the prompt.

      Returns Promise<number[]>

      Promise that resolves to the embedding vector.

    • Downloads (if needed) and loads the model and tokenizer via react-native-executorch. Overlapping calls share one load. An unload issued while the load is in flight wins unless load is called again before it settles.

      Returns Promise<ExecuTorchEmbeddings>

      Promise that resolves to the same instance.

    • Unloads the underlying model and releases its native resources. A load still in flight is awaited first so that nothing is left behind.

      Returns Promise<void>