Input to chat model class.

interface ChatPremInput {
    apiKey?: string;
    cache?: boolean | BaseCache<Generation[]>;
    callbackManager?: CallbackManager;
    callbacks?: Callbacks;
    frequency_penalty?: number;
    logit_bias?: {
        [k: string]: unknown;
    };
    maxConcurrency?: number;
    maxRetries?: number;
    max_tokens?: number;
    messages?: {
        content: string;
        role: "user" | "assistant";
        [k: string]: unknown;
    }[];
    metadata?: Record<string, unknown>;
    model?: string;
    n?: number;
    onFailedAttempt?: FailedAttemptHandler;
    presence_penalty?: number;
    project_id?: string | number;
    response_format?: {
        [k: string]: unknown;
    };
    seed?: number;
    session_id?: string;
    stop?: string;
    streaming?: boolean;
    system_prompt?: string;
    tags?: string[];
    temperature?: number;
    tools?: {
        [k: string]: unknown;
    }[];
    top_p?: number;
    user?: string;
    verbose?: boolean;
}

Hierarchy

  • BaseChatModelParams
    • ChatPremInput

Implemented by

Properties

apiKey?: string

The Prem API key to use for requests.

process.env.PREM_API_KEY
cache?: boolean | BaseCache<Generation[]>
callbackManager?: CallbackManager

Use callbacks instead

callbacks?: Callbacks
frequency_penalty?: number
logit_bias?: {
    [k: string]: unknown;
}
maxConcurrency?: number

The maximum number of concurrent calls that can be made. Defaults to Infinity, which means no limit.

maxRetries?: number

The maximum number of retries that can be made for a single call, with an exponential backoff between each attempt. Defaults to 6.

max_tokens?: number
messages?: {
    content: string;
    role: "user" | "assistant";
    [k: string]: unknown;
}[]
metadata?: Record<string, unknown>
model?: string
n?: number
onFailedAttempt?: FailedAttemptHandler

Custom handler to handle failed attempts. Takes the originally thrown error object as input, and should itself throw an error if the input error is not retryable.

presence_penalty?: number
project_id?: string | number
response_format?: {
    [k: string]: unknown;
}
seed?: number
session_id?: string
stop?: string
streaming?: boolean
system_prompt?: string
tags?: string[]
temperature?: number
tools?: {
    [k: string]: unknown;
}[]
top_p?: number
user?: string
verbose?: boolean