Fixed

data class Fixed(val contextLength: Long) : ContextWindowStrategy(source)

A strategy for specifying a fixed context window length. If the given contextLength is more than the maximum context window length supported by the model, the context window length will be set to the maximum context window length supported by the model.

Parameters

contextLength

The context window length to use.

Constructors

Link copied to clipboard
constructor(contextLength: Long)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun computeContextLength(prompt: Prompt, model: LLModel): Long

Computes the context length for a given prompt and language model. This may involve calculating the number of tokens used in the prompt and determining if it fits within the model's context length constraints.