Merge pull request #135 from ariel-frischer/fix-undefined-model

fix(agent_utils.py): add check for model attribute to prevent errors …
This commit is contained in:
Andrew I. Christianson 2025-03-15 12:25:37 -04:00 committed by GitHub
commit 9225ec3f2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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"]