Interface Generate<T>

interface Generate<T> {
    fetchObjects: ((generate, opts?) => Promise<GenerativeReturn<T>>);
    bm25(query, generate, opts?): Promise<GenerativeReturn<T>>;
    bm25(query, generate, opts): Promise<GenerativeGroupByReturn<T>>;
    bm25(query, generate, opts?): GenerateReturn<T>;
    hybrid(query, generate, opts?): Promise<GenerativeReturn<T>>;
    hybrid(query, generate, opts): Promise<GenerativeGroupByReturn<T>>;
    hybrid(query, generate, opts?): GenerateReturn<T>;
    nearMedia(media, type, generate, opts?): Promise<GenerativeReturn<T>>;
    nearMedia(media, type, generate, opts): Promise<GenerativeGroupByReturn<T>>;
    nearMedia(media, type, generate, opts?): GenerateReturn<T>;
    nearObject(id, generate, opts?): Promise<GenerativeReturn<T>>;
    nearObject(id, generate, opts): Promise<GenerativeGroupByReturn<T>>;
    nearObject(id, generate, opts?): GenerateReturn<T>;
    nearText(query, generate, opts?): Promise<GenerativeReturn<T>>;
    nearText(query, generate, opts): Promise<GenerativeGroupByReturn<T>>;
    nearText(query, generate, opts?): GenerateReturn<T>;
    nearVector(vector, generate, opts?): Promise<GenerativeReturn<T>>;
    nearVector(vector, generate, opts): Promise<GenerativeGroupByReturn<T>>;
    nearVector(vector, generate, opts?): GenerateReturn<T>;
}

Type Parameters

  • T

Hierarchy

  • Bm25<T>
  • Hybrid<T>
  • NearMedia<T>
  • NearObject<T>
  • NearText<T>
  • NearVector<T>
    • Generate

Properties

fetchObjects: ((generate, opts?) => Promise<GenerativeReturn<T>>)

Type declaration

Methods

  • Perform retrieval-augmented generation (RaG) on the results of a keyword-based BM25 search of objects in this collection.

    See the docs for a more detailed explanation.

    This overload is for performing a search without the groupBy param.

    Parameters

    • query: string

      The query to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: BaseBm25Options<T>

      The available options for performing the BM25 search.

    Returns Promise<GenerativeReturn<T>>

    • The results of the search including the generated data.
  • Perform retrieval-augmented generation (RaG) on the results of a keyword-based BM25 search of objects in this collection.

    See the docs for a more detailed explanation.

    This overload is for performing a search with the groupBy param.

    Parameters

    • query: string

      The query to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • opts: GroupByBm25Options<T>

      The available options for performing the BM25 search.

    Returns Promise<GenerativeGroupByReturn<T>>

    • The results of the search including the generated data grouped by the specified properties.
  • Perform retrieval-augmented generation (RaG) on the results of a keyword-based BM25 search of objects in this collection.

    See the docs for a more detailed explanation.

    This overload is for performing a search with a programmatically defined opts param.

    Parameters

    • query: string

      The query to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: Bm25Options<T>

      The available options for performing the BM25 search.

    Returns GenerateReturn<T>

    • The results of the search including the generated data.
  • Perform retrieval-augmented generation (RaG) on the results of an object search in this collection using the hybrid algorithm blending keyword-based BM25 and vector-based similarity.

    See the docs for a more detailed explanation.

    This overload is for performing a search without the groupBy param.

    Parameters

    • query: string

      The query to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: BaseHybridOptions<T>

      The available options for performing the hybrid search.

    Returns Promise<GenerativeReturn<T>>

    • The results of the search including the generated data.
  • Perform retrieval-augmented generation (RaG) on the results of an object search in this collection using the hybrid algorithm blending keyword-based BM25 and vector-based similarity.

    See the docs for a more detailed explanation.

    This overload is for performing a search with the groupBy param.

    Parameters

    • query: string

      The query to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • opts: GroupByHybridOptions<T>

      The available options for performing the hybrid search.

    Returns Promise<GenerativeGroupByReturn<T>>

    • The results of the search including the generated data grouped by the specified properties.
  • Perform retrieval-augmented generation (RaG) on the results of an object search in this collection using the hybrid algorithm blending keyword-based BM25 and vector-based similarity.

    See the docs for a more detailed explanation.

    This overload is for performing a search with a programmatically defined opts param.

    Parameters

    • query: string

      The query to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: HybridOptions<T>

      The available options for performing the hybrid search.

    Returns GenerateReturn<T>

    • The results of the search including the generated data.
  • Perform retrieval-augmented generation (RaG) on the results of a by-audio object search in this collection using an audio-capable vectorization module and vector-based similarity search.

    See the docs for a more detailed explanation.

    NOTE: You must have a multi-media-capable vectorization module installed in order to use this method, e.g. multi2vec-bind.

    This overload is for performing a search without the groupBy param.

    Parameters

    • media: string | Buffer

      The media file to search on. This can be a base64 string, a file path string, or a buffer.

    • type: NearMediaType

      The type of media to search on.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: BaseNearOptions<T>

      The available options for performing the near-media search.

    Returns Promise<GenerativeReturn<T>>

    • The results of the search including the generated data.
  • Perform retrieval-augmented generation (RaG) on the results of a by-audio object search in this collection using an audio-capable vectorization module and vector-based similarity search.

    See the docs for a more detailed explanation.

    NOTE: You must have a multi-media-capable vectorization module installed in order to use this method, e.g. multi2vec-bind.

    This overload is for performing a search with the groupBy param.

    Parameters

    • media: string | Buffer

      The media file to search on. This can be a base64 string, a file path string, or a buffer.

    • type: NearMediaType

      The type of media to search on.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • opts: GroupByNearOptions<T>

      The available options for performing the near-media search.

    Returns Promise<GenerativeGroupByReturn<T>>

    • The results of the search including the generated data grouped by the specified properties.
  • Perform retrieval-augmented generation (RaG) on the results of a by-audio object search in this collection using an audio-capable vectorization module and vector-based similarity search.

    See the docs for a more detailed explanation.

    NOTE: You must have a multi-media-capable vectorization module installed in order to use this method, e.g. multi2vec-bind.

    This overload is for performing a search with a programmatically defined opts param.

    Parameters

    • media: string | Buffer

      The media to search on. This can be a base64 string, a file path string, or a buffer.

    • type: NearMediaType

      The type of media to search on.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: NearOptions<T>

      The available options for performing the near-media search.

    Returns GenerateReturn<T>

    • The results of the search including the generated data.
  • Perform retrieval-augmented generation (RaG) on the results of a by-object object search in this collection using a vector-based similarity search.

    See the docs for a more detailed explanation.

    This overload is for performing a search without the groupBy param.

    Parameters

    • id: string

      The ID of the object to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: BaseNearOptions<T>

      The available options for performing the near-object search.

    Returns Promise<GenerativeReturn<T>>

    • The results of the search including the generated data.
  • Perform retrieval-augmented generation (RaG) on the results of a by-object object search in this collection using a vector-based similarity search.

    See the docs for a more detailed explanation.

    This overload is for performing a search with the groupBy param.

    Parameters

    • id: string

      The ID of the object to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • opts: GroupByNearOptions<T>

      The available options for performing the near-object search.

    Returns Promise<GenerativeGroupByReturn<T>>

    • The results of the search including the generated data grouped by the specified properties.
  • Perform retrieval-augmented generation (RaG) on the results of a by-object object search in this collection using a vector-based similarity search.

    See the docs for a more detailed explanation.

    This overload is for performing a search with a programmatically defined opts param.

    Parameters

    • id: string

      The ID of the object to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: NearOptions<T>

      The available options for performing the near-object search.

    Returns GenerateReturn<T>

    • The results of the search including the generated data.
  • Perform retrieval-augmented generation (RaG) on the results of a by-image object search in this collection using the image-capable vectorization module and vector-based similarity search.

    See the docs for a more detailed explanation.

    NOTE: You must have a text-capable vectorization module installed in order to use this method, e.g. any of the text2vec- and multi2vec- modules.

    This overload is for performing a search without the groupBy param.

    Parameters

    • query: string | string[]

      The query to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: BaseNearTextOptions<T>

      The available options for performing the near-text search.

    Returns Promise<GenerativeReturn<T>>

    • The results of the search including the generated data.
  • Perform retrieval-augmented generation (RaG) on the results of a by-image object search in this collection using the image-capable vectorization module and vector-based similarity search.

    See the docs for a more detailed explanation.

    NOTE: You must have a text-capable vectorization module installed in order to use this method, e.g. any of the text2vec- and multi2vec- modules.

    This overload is for performing a search with the groupBy param.

    Parameters

    • query: string | string[]

      The query to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • opts: GroupByNearTextOptions<T>

      The available options for performing the near-text search.

    Returns Promise<GenerativeGroupByReturn<T>>

    • The results of the search including the generated data grouped by the specified properties.
  • Perform retrieval-augmented generation (RaG) on the results of a by-image object search in this collection using the image-capable vectorization module and vector-based similarity search.

    See the docs for a more detailed explanation.

    NOTE: You must have a text-capable vectorization module installed in order to use this method, e.g. any of the text2vec- and multi2vec- modules.

    This overload is for performing a search with a programmatically defined opts param.

    Parameters

    • query: string | string[]

      The query to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: NearTextOptions<T>

      The available options for performing the near-text search.

    Returns GenerateReturn<T>

    • The results of the search including the generated data.
  • Perform retrieval-augmented generation (RaG) on the results of a by-vector object search in this collection using vector-based similarity search.

    See the docs for a more detailed explanation.

    This overload is for performing a search without the groupBy param.

    Parameters

    • vector: NearVectorInputType

      The vector(s) to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: BaseNearOptions<T>

      The available options for performing the near-vector search.

    Returns Promise<GenerativeReturn<T>>

    • The results of the search including the generated data.
  • Perform retrieval-augmented generation (RaG) on the results of a by-vector object search in this collection using vector-based similarity search.

    See the docs for a more detailed explanation.

    This overload is for performing a search with the groupBy param.

    Parameters

    • vector: NearVectorInputType

      The vector(s) to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • opts: GroupByNearOptions<T>

      The available options for performing the near-vector search.

    Returns Promise<GenerativeGroupByReturn<T>>

    • The results of the search including the generated data grouped by the specified properties.
  • Perform retrieval-augmented generation (RaG) on the results of a by-vector object search in this collection using vector-based similarity search.

    See the docs for a more detailed explanation.

    This overload is for performing a search with a programmatically defined opts param.

    Parameters

    • vector: NearVectorInputType

      The vector(s) to search for.

    • generate: GenerateOptions<T>

      The available options for performing the generation.

    • Optional opts: NearOptions<T>

      The available options for performing the near-vector search.

    Returns GenerateReturn<T>

    • The results of the search including the generated data.