Represents the parameters for a base chat model.

Hierarchy

Properties

modelName: string

Model name to use

n: number

Number of completions to generate for each prompt

streaming: boolean

Whether to stream the results or not. Enabling disables tokenUsage reporting

temperature: number

Sampling temperature to use

topP: number

Total probability mass of tokens to consider at each step

cache?: boolean | BaseCache<Generation[]>
callbackManager?: CallbackManager

⚠️ Deprecated ⚠️

Use callbacks instead

This feature is deprecated and will be removed in the future.

It is not recommended for use.

callbacks?: Callbacks
logprobs?: boolean

Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.

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.

maxTokens?: number

Maximum number of tokens to generate in the completion. -1 returns as many tokens as possible given the prompt and the model's maximum context size.

metadata?: Record<string, unknown>
modelKwargs?: Record<string, any>

Holds any additional parameters that are valid to pass to openai.createCompletion that are not explicitly specified on this class.

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.

prefixMessages?: ChatCompletionMessageParam[]

ChatGPT messages to pass as a prefix to the prompt

stop?: string[]

List of stop words to use when generating

tags?: string[]
timeout?: number

Timeout to use when making requests to OpenAI.

togetherAIApiKey?: string

The TogetherAI API key to use for requests.

Default

process.env.TOGETHER_AI_API_KEY
topLogprobs?: number

An integer between 0 and 5 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.

user?: string

Unique string identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

verbose?: boolean

Generated using TypeDoc