mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
- Add _check_context_length_before_call() method to CrewAgentExecutor - Proactively check estimated token count before LLM calls in _invoke_loop - Use character-based estimation (chars / 4) to approximate token count - Call existing _handle_context_length() when context window would be exceeded - Add comprehensive tests covering proactive handling and token estimation - Prevents empty responses from providers like DeepInfra that don't throw exceptions Co-Authored-By: João <joao@crewai.com>
52 KiB
52 KiB