Class representing the AI21 language model. It extends the LLM (Large Language Model) class, providing a standard interface for interacting with the AI21 language model.

Hierarchy

Implements

Constructors

Properties

countPenalty: AI21PenaltyData = ...
frequencyPenalty: AI21PenaltyData = ...
maxTokens: number = 1024
minTokens: number = 0
model: string = "j2-jumbo-instruct"
numResults: number = 1
presencePenalty: AI21PenaltyData = ...
temperature: number = 0.7
topP: number = 1
ai21ApiKey?: string
baseUrl?: string
logitBias?: Record<string, number>
stop?: string[]

Accessors

  • get defaultParams(): {
        countPenalty: AI21PenaltyData;
        frequencyPenalty: AI21PenaltyData;
        logitBias: undefined | Record<string, number>;
        maxTokens: number;
        minTokens: number;
        numResults: number;
        presencePenalty: AI21PenaltyData;
        temperature: number;
        topP: number;
    }
  • Get the default parameters for calling AI21 API.

    Returns {
        countPenalty: AI21PenaltyData;
        frequencyPenalty: AI21PenaltyData;
        logitBias: undefined | Record<string, number>;
        maxTokens: number;
        minTokens: number;
        numResults: number;
        presencePenalty: AI21PenaltyData;
        temperature: number;
        topP: number;
    }

    • countPenalty: AI21PenaltyData
    • frequencyPenalty: AI21PenaltyData
    • logitBias: undefined | Record<string, number>
    • maxTokens: number
    • minTokens: number
    • numResults: number
    • presencePenalty: AI21PenaltyData
    • temperature: number
    • topP: number
  • get identifyingParams(): {
        countPenalty: AI21PenaltyData;
        frequencyPenalty: AI21PenaltyData;
        logitBias: undefined | Record<string, number>;
        maxTokens: number;
        minTokens: number;
        model: string;
        numResults: number;
        presencePenalty: AI21PenaltyData;
        temperature: number;
        topP: number;
    }
  • Get the identifying parameters for this LLM.

    Returns {
        countPenalty: AI21PenaltyData;
        frequencyPenalty: AI21PenaltyData;
        logitBias: undefined | Record<string, number>;
        maxTokens: number;
        minTokens: number;
        model: string;
        numResults: number;
        presencePenalty: AI21PenaltyData;
        temperature: number;
        topP: number;
    }

    • countPenalty: AI21PenaltyData
    • frequencyPenalty: AI21PenaltyData
    • logitBias: undefined | Record<string, number>
    • maxTokens: number
    • minTokens: number
    • model: string
    • numResults: number
    • presencePenalty: AI21PenaltyData
    • temperature: number
    • topP: number

Methods

Generated using TypeDoc