Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

fix: python verifier does not handle string comparison properly (#2042)

Junxiao Yange23e5f0a22cb
diff --git a/camel/verifiers/python_verifier.py b/camel/verifiers/python_verifier.py
index 426ef9064..f6fbcbf6f 100644
--- a/camel/verifiers/python_verifier.py
+++ b/camel/verifiers/python_verifier.py
@@ -317,19 +317,9 @@ class PythonVerifier(BaseVerifier):
sol_val = ast.literal_eval(sol_out)
except Exception as e:
logger.warning(
- f"Direct eval failed: {e}. Trying repr on output."
+ f"Direct eval failed: {e}."
)
- try:
- # Try to convert sol_out to a literal
- # by wrapping it with repr.
- # FIXME: may be unnecessary
- sol_val = ast.literal_eval(repr(sol_out))
- except Exception as e2:
- logger.warning(
- f"repr eval also failed: {e2}."
- "Falling back to string comparison."
- )
- sol_val = None
+ sol_val = None
if sol_val is not None:
try: