-
Notifications
You must be signed in to change notification settings - Fork 289
Open
Description
Issue Description
The application is encountering an import error when trying to use tools_condition from langgraph.prebuilt:
ImportError: cannot import name 'tools_condition' from 'langgraph.prebuilt' (unknown location)
Root Cause
The tools_condition function was introduced in LangGraph version 0.6.x, but the current dependency constraint allows for older versions that don't include this function.
Current State
- Current dependency:
langgraph>=0.2.70(in pyproject.toml) - Required version:
langgraph>=0.6.3 - Error location: Import statements using
from langgraph.prebuilt import tools_condition
Solution
Update the LangGraph dependency version constraint in pyproject.toml:
# Before
langgraph>=0.2.70
# After
langgraph>=0.6.3Steps to Implement
- Update
pyproject.tomlwith new version constraint - Run
uv lockto update the lock file - Run
uv syncto install the updated packages - Test that
tools_conditioncan be imported successfully - Verify all existing LangGraph functionality still works
- Update any code that might be affected by API changes
Testing Checklist
- Import test:
from langgraph.prebuilt import tools_condition - Backend starts without import errors
- All existing LangGraph workflows continue to function
- Docker build succeeds with new dependencies
Files to Modify
philoagents-api/pyproject.toml(line 13)
Migration Notes
LangGraph 0.6.x may include breaking changes. Review the LangGraph changelog for any API changes that might affect existing code.
Related Issues
- Dependency management
- Import errors
- Backend startup failures
Priority
High - This blocks the application from starting correctly.
Metadata
Metadata
Assignees
Labels
No labels