Skip to content

ContextWindowEstimate

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The result of a pre-flight context-window check, computed without calling the model provider.

public sealed record ContextWindowEstimate : IEquatable<ContextWindowEstimate>

objectContextWindowEstimate

IEquatable<ContextWindowEstimate>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

public ContextWindowEstimate()

Gets the token budget kept for the prompt after AgentPrismPreflightOptions.ReserveRatio is set aside for the answer. null when ContextWindowTokens is unknown.

public required int? AllowedPromptTokens { get; init; }

int?

Gets the model’s context window size, taken from the model catalog’s ModelDescriptor.ContextWindowTokens. null when the model is not found in the catalog.

public required int? ContextWindowTokens { get; init; }

int?

Gets the estimated token count of the prompt. The estimate is approximate.

public required int PromptTokens { get; init; }

int

Gets whether a real run with this prompt would be rejected by the pre-flight check. Always false when ContextWindowTokens is unknown — an unknown window can never be exceeded.

public required bool WouldBeRejected { get; init; }

bool

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(ContextWindowEstimate? other)

other ContextWindowEstimate?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(ContextWindowEstimate?, ContextWindowEstimate?)

Section titled “ operator ==(ContextWindowEstimate?, ContextWindowEstimate?)”
public static bool operator ==(ContextWindowEstimate? left, ContextWindowEstimate? right)

left ContextWindowEstimate?

right ContextWindowEstimate?

bool

operator !=(ContextWindowEstimate?, ContextWindowEstimate?)

Section titled “ operator !=(ContextWindowEstimate?, ContextWindowEstimate?)”
public static bool operator !=(ContextWindowEstimate? left, ContextWindowEstimate? right)

left ContextWindowEstimate?

right ContextWindowEstimate?

bool