ContextSize Property  
 

Returns the maximum context window size, in tokens, reported for the current model.

Syntax

object.ContextSize

Remarks

The ContextSize property is an Integer value that specifies the maximum context window size, in tokens, reported for the current model. The context window represents the total amount of text the model can process in a single request, including prompts, responses, system instructions and retained conversation history. Models with larger context windows can generally process longer conversations, larger documents and more extensive prompts before older content must be discarded or truncated.

Most cloud-based service providers offer models which support very large context windows while limiting the maximum number of tokens that can be generated in a single response. For example, a model may support a context window of 1,000,000 tokens, allowing it to process very large conversations or documents, while limiting individual responses to 128,000 output tokens.

The context window size returned by this property is advisory. The value should be treated as general guidance and is not enforced by the control. The actual limits on the context size may vary depending on the provider, model version, deployment, enabled features and user account. A value of zero means the context size cannot be determined for the current model. For locally hosted models or cloud-based aggregators, these limits may also be configurable for a specific model.

Data Type

Integer (Int32)

See Also

ContextUsed Property, InputTokens Property, MaxTokens Property, ModelName Property, OutputTokens Property, TotalTokens Property