Commit Graph

2 Commits

Author SHA1 Message Date
Devin AI
bfe3931dcd fix: resolve CI failures for fallback LLM implementation
- Fix type checker error by adding None check before raising last_exception
- Fix ContextWindowExceededError constructor with correct signature (message, model, llm_provider)
- Update auth error test assertion to match new print message format

Co-Authored-By: João <joao@crewai.com>
2025-06-19 06:13:44 +00:00
Devin AI
06e2683fd8 feat: implement fallback LLMs for agent execution
- Add fallback_llms field to Agent class to support multiple LLM fallbacks
- Modify get_llm_response in agent_utils.py to try fallback LLMs when primary fails
- Update CrewAgentExecutor and LiteAgent to pass fallback LLMs to get_llm_response
- Add smart error handling that skips fallbacks for auth errors but tries them for other failures
- Add comprehensive tests covering all fallback scenarios
- Maintain full backward compatibility for agents without fallback LLMs

Addresses GitHub Issue #3032: Support Fallback LLMs for Agent Execution

Co-Authored-By: João <joao@crewai.com>
2025-06-19 06:02:39 +00:00