refactor: add string validation for feedback attrs and remove unused var (#1035)

This commit is contained in:
you-n-g
2025-07-08 20:24:31 +08:00
committed by GitHub
parent 3f9c1afea8
commit e0ba3b0eee
2 changed files with 4 additions and 1 deletions
@@ -70,6 +70,10 @@ class CoSTEERSingleFeedback(Feedback):
if not isinstance(data["final_decision"], bool):
raise ValueError(f"'final_decision' must be a boolean, not {type(data['final_decision'])}")
for attr in "execution", "return_checking", "code":
if data[attr] is not None and not isinstance(data[attr], str):
raise ValueError(f"'{attr}' must be a string, not {type(data[attr])}")
return data
def __str__(self) -> str: