From bef504d756d4c6f415552c8b937eccb4243fde7b Mon Sep 17 00:00:00 2001 From: Ariel Frischer Date: Sat, 15 Mar 2025 09:23:01 -0700 Subject: [PATCH] fix(agent_utils.py): add check for model attribute to prevent errors when model does not have 'model' attribute --- ra_aid/agent_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ra_aid/agent_utils.py b/ra_aid/agent_utils.py index 1bb2ccd..d952c2c 100644 --- a/ra_aid/agent_utils.py +++ b/ra_aid/agent_utils.py @@ -102,6 +102,9 @@ def build_agent_kwargs( ): def wrapped_state_modifier(state: AgentState) -> list[BaseMessage]: + if not hasattr(model, 'model'): + return state_modifier(state, model, max_input_tokens=max_input_tokens) + if any( pattern in model.model for pattern in ["claude-3.5", "claude3.5", "claude-3-5"]