feat: Rewrite agents (#2232)

This commit is contained in:
Matthew Zhou
2024-12-13 14:43:19 -08:00
committed by GitHub
parent 65fd731917
commit 7908b8a15f
86 changed files with 2495 additions and 3980 deletions

View File

@@ -548,13 +548,13 @@ def enforce_types(func):
for arg_name, arg_value in args_with_hints.items():
hint = hints.get(arg_name)
if hint and not matches_type(arg_value, hint):
raise ValueError(f"Argument {arg_name} does not match type {hint}")
raise ValueError(f"Argument {arg_name} does not match type {hint}; is {arg_value}")
# Check types of keyword arguments
for arg_name, arg_value in kwargs.items():
hint = hints.get(arg_name)
if hint and not matches_type(arg_value, hint):
raise ValueError(f"Argument {arg_name} does not match type {hint}")
raise ValueError(f"Argument {arg_name} does not match type {hint}; is {arg_value}")
return func(*args, **kwargs)