fix(agent_utils.py): add check for model attribute to prevent errors when model does not have 'model' attribute

This commit is contained in:
Ariel Frischer 2025-03-15 09:23:01 -07:00
parent 75636f0477
commit bef504d756
1 changed files with 3 additions and 0 deletions

View File

@ -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"]