Defined in order to have this type available for future use with additional properties beyond the BaseParams type.

Hierarchy (view full)

Constructors

Properties

cancellationToken?: AbortSignal

Optional cancellation token to abort the chat completion request. When this signal is aborted, the provider should cancel the request and return a cancelled result as gracefully as possible.

effortLevel?: string

If the model supports effort levels, this parameter can be used to specify the effort level.

enableCaching?: boolean = true

Whether to enable caching for this request. Implementation depends on the specific provider (the below are examples, many other providers exist):

  • For Anthropic: Uses Anthropic's ephemeral cache control to cache system prompt and last user message.
  • For OpenAI: Uses automatic caching (provider handles it).
  • For other providers: May be a no-op if caching isn't supported.

Default

true - Caching is enabled by default for providers that support it.
frequencyPenalty?: number

Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

includeLogProbs?: boolean = false

Not all AI providers support this feature. When supported, this parameter indicates if logprobs are requested. Logprobs provide information about the likelihood of each token in the response. This can be useful for debugging or understanding the model's behavior. When models support this and this property is set to true, the model will return logprobs for the tokens in the

See

  • ChatResultData object within the array of
  • ChatResultChoice objects.
maxOutputTokens?: number

Model max output response tokens, optional.

messages: ChatMessage<any>[] = []

Array of messages, allows full control over the order and content of the conversation.

minP?: number

Minimum probability threshold for token sampling (0-1). Tokens with probability below this threshold are filtered out before sampling. This is a newer parameter not yet widely supported.

model: string

Model name, required.

modelSpecificResponseFormat?: any

The standard response formats may not be sufficient for all models. This field allows for a model-specific response format to be specified. For this field to be used, responseFormat must be set to 'ModelSpecific'.

presencePenalty?: number

Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

reasoningBudgetTokens?: number

Model max budget tokens that we may use for reasoning in reasoning models, optional.

responseFormat?: "Any" | "Text" | "Markdown" | "JSON" | "ModelSpecific" = 'Any'

Specifies the format that the model should output. Not all models support all formats. If not specified, the default is 'Any'.

seed?: number

Optional seed for reproducible outputs. Not all models support seeding, but when supported, using the same seed with the same inputs should produce identical outputs.

stopSequences?: string[]

Optional array of sequences where the model will stop generating further tokens. The returned text will not contain the stop sequence.

streaming?: boolean = false

Whether to use streaming for this request. If true and the provider supports streaming, responses will be streamed. If true but the provider doesn't support streaming, the request will fall back to non-streaming.

streamingCallbacks?: StreamingChatCallbacks

Callbacks for streaming responses. Only used when streaming is true.

temperature?: number

Model temperature, optional.

topK?: number

Top-k sampling parameter. Limits the model to only sample from the top K most likely tokens at each step. For example, k=50 means the model will only consider the 50 most likely next tokens. Not supported by all providers (e.g., OpenAI doesn't support this).

topLogProbs?: number

Number of top log probabilities to return per token. Only used when includeLogProbs is true. Typically ranges from 2-20, depending on the provider.

topP?: number

Top-p (nucleus) sampling parameter (0-1). An alternative to temperature sampling that considers the smallest set of tokens whose cumulative probability exceeds the probability p. For example, 0.1 means only the tokens comprising the top 10% probability mass are considered. Generally, use either temperature OR top-p, not both.