langchain.js
    Preparing search index...

    Specific implementation of a Large Language Model (LLM) designed to interact with the Aleph Alpha API. It extends the base LLM class and includes a variety of parameters for customizing the behavior of the Aleph Alpha model.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Parameters

      Returns AlephAlpha

    Properties

    aleph_alpha_api_key?: any = ...
    base_url: string = "https://api.aleph-alpha.com/complete"
    best_of?: number
    completion_bias_exclusion?: string[]
    completion_bias_exclusion_first_token_only: boolean
    completion_bias_inclusion?: string[]
    completion_bias_inclusion_first_token_only: boolean
    contextual_control_threshold?: number
    control_log_additive: boolean
    disable_optimizations?: boolean
    echo: boolean
    frequency_penalty?: number
    lc_serializable: boolean = true
    log_probs?: number
    logit_bias?: object
    maximum_tokens: number = 64
    minimum_tokens: number = 0
    model: string = "luminous-base"
    n?: number
    penalty_bias?: string
    penalty_exceptions?: string[]
    penalty_exceptions_include_stop_sequences?: boolean
    presence_penalty?: number
    raw_completion: boolean
    repetition_penalties_include_completion?: boolean
    repetition_penalties_include_prompt?: boolean
    sequence_penalty?: number
    sequence_penalty_min_length?: number
    stop?: string[]
    temperature: number = 0.0
    tokens?: boolean
    top_k: number
    top_p: number = 0.0
    use_multiplicative_frequency_penalty?: boolean
    use_multiplicative_presence_penalty?: boolean
    use_multiplicative_sequence_penalty?: boolean

    Accessors

    • get defaultParams(): {
          best_of: undefined
          | number;
          completion_bias_exclusion: undefined | string[];
          completion_bias_exclusion_first_token_only: boolean;
          completion_bias_inclusion: undefined | string[];
          completion_bias_inclusion_first_token_only: boolean;
          contextual_control_threshold: undefined | number;
          control_log_additive: boolean;
          disable_optimizations: undefined | boolean;
          frequency_penalty: undefined | number;
          log_probs: undefined | number;
          logit_bias: undefined | object;
          maximum_tokens: number;
          minimum_tokens: number;
          model: string;
          n: undefined | number;
          penalty_bias: undefined | string;
          penalty_exceptions: undefined | string[];
          penalty_exceptions_include_stop_sequences: undefined | boolean;
          presence_penalty: undefined | number;
          raw_completion: boolean;
          repetition_penalties_include_completion: undefined | boolean;
          repetition_penalties_include_prompt: undefined | boolean;
          sequence_penalty: undefined | number;
          sequence_penalty_min_length: undefined | number;
          temperature: number;
          tokens: undefined | boolean;
          top_k: number;
          top_p: number;
          use_multiplicative_frequency_penalty: undefined | boolean;
          use_multiplicative_presence_penalty: undefined | boolean;
          use_multiplicative_sequence_penalty: undefined | boolean;
      }

      Get the default parameters for calling Aleph Alpha API.

      Returns {
          best_of: undefined | number;
          completion_bias_exclusion: undefined | string[];
          completion_bias_exclusion_first_token_only: boolean;
          completion_bias_inclusion: undefined | string[];
          completion_bias_inclusion_first_token_only: boolean;
          contextual_control_threshold: undefined | number;
          control_log_additive: boolean;
          disable_optimizations: undefined | boolean;
          frequency_penalty: undefined | number;
          log_probs: undefined | number;
          logit_bias: undefined | object;
          maximum_tokens: number;
          minimum_tokens: number;
          model: string;
          n: undefined | number;
          penalty_bias: undefined | string;
          penalty_exceptions: undefined | string[];
          penalty_exceptions_include_stop_sequences: undefined | boolean;
          presence_penalty: undefined | number;
          raw_completion: boolean;
          repetition_penalties_include_completion: undefined | boolean;
          repetition_penalties_include_prompt: undefined | boolean;
          sequence_penalty: undefined | number;
          sequence_penalty_min_length: undefined | number;
          temperature: number;
          tokens: undefined | boolean;
          top_k: number;
          top_p: number;
          use_multiplicative_frequency_penalty: undefined | boolean;
          use_multiplicative_presence_penalty: undefined | boolean;
          use_multiplicative_sequence_penalty: undefined | boolean;
      }

    • get identifyingParams(): {
          best_of: undefined
          | number;
          completion_bias_exclusion: undefined | string[];
          completion_bias_exclusion_first_token_only: boolean;
          completion_bias_inclusion: undefined | string[];
          completion_bias_inclusion_first_token_only: boolean;
          contextual_control_threshold: undefined | number;
          control_log_additive: boolean;
          disable_optimizations: undefined | boolean;
          frequency_penalty: undefined | number;
          log_probs: undefined | number;
          logit_bias: undefined | object;
          maximum_tokens: number;
          minimum_tokens: number;
          model: string;
          n: undefined | number;
          penalty_bias: undefined | string;
          penalty_exceptions: undefined | string[];
          penalty_exceptions_include_stop_sequences: undefined | boolean;
          presence_penalty: undefined | number;
          raw_completion: boolean;
          repetition_penalties_include_completion: undefined | boolean;
          repetition_penalties_include_prompt: undefined | boolean;
          sequence_penalty: undefined | number;
          sequence_penalty_min_length: undefined | number;
          temperature: number;
          tokens: undefined | boolean;
          top_k: number;
          top_p: number;
          use_multiplicative_frequency_penalty: undefined | boolean;
          use_multiplicative_presence_penalty: undefined | boolean;
          use_multiplicative_sequence_penalty: undefined | boolean;
      }

      Get the identifying parameters for this LLM.

      Returns {
          best_of: undefined | number;
          completion_bias_exclusion: undefined | string[];
          completion_bias_exclusion_first_token_only: boolean;
          completion_bias_inclusion: undefined | string[];
          completion_bias_inclusion_first_token_only: boolean;
          contextual_control_threshold: undefined | number;
          control_log_additive: boolean;
          disable_optimizations: undefined | boolean;
          frequency_penalty: undefined | number;
          log_probs: undefined | number;
          logit_bias: undefined | object;
          maximum_tokens: number;
          minimum_tokens: number;
          model: string;
          n: undefined | number;
          penalty_bias: undefined | string;
          penalty_exceptions: undefined | string[];
          penalty_exceptions_include_stop_sequences: undefined | boolean;
          presence_penalty: undefined | number;
          raw_completion: boolean;
          repetition_penalties_include_completion: undefined | boolean;
          repetition_penalties_include_prompt: undefined | boolean;
          sequence_penalty: undefined | number;
          sequence_penalty_min_length: undefined | number;
          temperature: number;
          tokens: undefined | boolean;
          top_k: number;
          top_p: number;
          use_multiplicative_frequency_penalty: undefined | boolean;
          use_multiplicative_presence_penalty: undefined | boolean;
          use_multiplicative_sequence_penalty: undefined | boolean;
      }

    Methods

    • Parameters

      • prompt: string
      • options: unknown

      Returns Promise<string>

    • Get the type of LLM.

      Returns string

    • Validates the environment by ensuring the necessary Aleph Alpha API key is available. Throws an error if the API key is missing.

      Returns void