Skip to content

Commit d3a3dab

Browse files
authored
Fix warning in model field access (#3340)
1 parent fadeffe commit d3a3dab

File tree

1 file changed

+1
-1
lines changed
  • livekit-agents/livekit/agents/llm

1 file changed

+1
-1
lines changed

livekit-agents/livekit/agents/llm/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def _is_optional_type(hint: Any) -> bool:
407407

408408
def _shallow_model_dump(model: BaseModel, *, by_alias: bool = False) -> dict[str, Any]:
409409
result = {}
410-
for name, field in model.model_fields.items():
410+
for name, field in model.__class__.model_fields.items():
411411
key = field.alias if by_alias and field.alias else name
412412
result[key] = getattr(model, name)
413413
return result

0 commit comments

Comments
 (0)