An abstract class that provides methods for embedding documents and queries using LangChain.

Hierarchy

Constructors

Properties

baseUrl: string = "http://localhost:11434"
caller: AsyncCaller

The async caller should be used by subclasses to make any async calls, which will thus benefit from the concurrency and retry logic.

model: string = "llama2"
requestOptions?: {
    embedding_only?: boolean;
    f16_kv?: boolean;
    frequency_penalty?: number;
    logits_all?: boolean;
    low_vram?: boolean;
    main_gpu?: number;
    mirostat?: number;
    mirostat_eta?: number;
    mirostat_tau?: number;
    num_batch?: number;
    num_ctx?: number;
    num_gpu?: number;
    num_gqa?: number;
    num_keep?: number;
    num_predict?: number;
    num_thread?: number;
    penalize_newline?: boolean;
    presence_penalty?: number;
    repeat_last_n?: number;
    repeat_penalty?: number;
    rope_frequency_base?: number;
    rope_frequency_scale?: number;
    stop?: string[];
    temperature?: number;
    tfs_z?: number;
    top_k?: number;
    top_p?: number;
    typical_p?: number;
    use_mlock?: boolean;
    use_mmap?: boolean;
    vocab_only?: boolean;
}

Type declaration

  • Optional embedding_only?: boolean
  • Optional f16_kv?: boolean
  • Optional frequency_penalty?: number
  • Optional logits_all?: boolean
  • Optional low_vram?: boolean
  • Optional main_gpu?: number
  • Optional mirostat?: number
  • Optional mirostat_eta?: number
  • Optional mirostat_tau?: number
  • Optional num_batch?: number
  • Optional num_ctx?: number
  • Optional num_gpu?: number
  • Optional num_gqa?: number
  • Optional num_keep?: number
  • Optional num_predict?: number
  • Optional num_thread?: number
  • Optional penalize_newline?: boolean
  • Optional presence_penalty?: number
  • Optional repeat_last_n?: number
  • Optional repeat_penalty?: number
  • Optional rope_frequency_base?: number
  • Optional rope_frequency_scale?: number
  • Optional stop?: string[]
  • Optional temperature?: number
  • Optional tfs_z?: number
  • Optional top_k?: number
  • Optional top_p?: number
  • Optional typical_p?: number
  • Optional use_mlock?: boolean
  • Optional use_mmap?: boolean
  • Optional vocab_only?: boolean

Methods

  • An abstract method that takes an array of documents as input and returns a promise that resolves to an array of vectors for each document.

    Parameters

    • documents: string[]

      An array of documents to be embedded.

    Returns Promise<number[][]>

    A promise that resolves to an array of vectors for each document.

  • An abstract method that takes a single document as input and returns a promise that resolves to a vector for the query document.

    Parameters

    • document: string

      A single document to be embedded.

    Returns Promise<number[]>

    A promise that resolves to a vector for the query document.

Generated using TypeDoc