Skip to content

Add ContextLengthExceededError and validator#427

Open
SaSteMi wants to merge 1 commit into
theroyallab:mainfrom
SaSteMi:main
Open

Add ContextLengthExceededError and validator#427
SaSteMi wants to merge 1 commit into
theroyallab:mainfrom
SaSteMi:main

Conversation

@SaSteMi

@SaSteMi SaSteMi commented Jun 13, 2026

Copy link
Copy Markdown

Introduce a ContextLengthExceededError exception and validate_context_requirements() helper to enforce prompt/context length constraints. The validator raises when context_len exceeds max_seq_len or when context_len + max_tokens would exceed an optional cache_max_num_tokens; additional optional parameters (max_rq_tokens, allocation_boundary) are present for future checks.

I'm new to this to, this fix was generated by Antigravity, but I thought I'd share cause it works for me now.

Is your pull request related to a problem? Please describe.
This fixes issue #426.

Why should this feature be added?
I think it fixes the issue.

Introduce a ContextLengthExceededError exception and validate_context_requirements() helper to enforce prompt/context length constraints. The validator raises when context_len exceeds max_seq_len or when context_len + max_tokens would exceed an optional cache_max_num_tokens; additional optional parameters (max_rq_tokens, allocation_boundary) are present for future checks.

This fixes [issue theroyallab#426](theroyallab#426).

I'm new to this to, this fix was generated by Antigravity, but I thought I'd share cause it works for me now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] common.errors module missing but imported in multiple core files (main branch)

1 participant