Add context overflow detection utilities

Extract overflow detection logic into reusable utilities:
- isContextOverflowError() to detect overflow from error messages
- isContextOverflowFromUsage() to detect overflow from token usage
- Patterns for Anthropic, OpenAI, Google, xAI, Groq, OpenRouter, llama.cpp, LM Studio

Fixes #129
This commit is contained in:
Mario Zechner 2025-12-06 21:24:15 +01:00
parent 10a1e1ef90
commit a325c1c7d1
3 changed files with 575 additions and 0 deletions

View file

@ -6,4 +6,5 @@ export * from "./providers/openai-completions.js";
export * from "./providers/openai-responses.js";
export * from "./stream.js";
export * from "./types.js";
export * from "./utils/overflow.js";
export * from "./utils/typebox-helpers.js";