You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor the LangChainChatManager class into a base class and model-specific child classes to handle differences between Gemini model versions that leak through the LangChain API.
Context
Different Gemini model versions have different capabilities and behaviors
LangChain API doesn't fully abstract these differences
Model-specific handling is currently mixed in a single class
Inheritance hierarchy would make model-specific code paths explicit
classGeminiChatManager:
"""Base class for Gemini-based chat management"""# Common functionality across all Gemini modelsclassGemini2_5ChatManager(GeminiChatManager):
"""Child class for Gemini 2.5-specific features"""# Handles Gemini 2.5-specific quirks and featuresclassGemini3PlusChatManager(GeminiChatManager):
"""Child class for Gemini 3+ specific features"""# Handles Gemini 3+ specific quirks and features
Rationale
Different Gemini model versions have different capabilities and behaviors
LangChain API doesn't fully abstract these differences
Model-specific handling is currently mixed in a single class
Inheritance hierarchy would make model-specific code paths explicit
Benefits
Clear separation of model-specific logic
Easier to add support for new Gemini versions
Better testability of model-specific features
Reduced conditional logic in core class
Impact
Moderate refactoring of backend/tenantfirstaid/langchain_chat_manager.py and related tests
Description
Refactor the
LangChainChatManagerclass into a base class and model-specific child classes to handle differences between Gemini model versions that leak through the LangChain API.Context
Proposed Structure
Rationale
Benefits
Impact
Moderate refactoring of
backend/tenantfirstaid/langchain_chat_manager.pyand related testsPriority
🟡 MEDIUM
Parent Issue
#254
References
backend/tenantfirstaid/langchain_chat_manager.py