mirror of
https://github.com/microsoft/autogen.git
synced 2025-08-10 09:42:18 +00:00

* Add isort * Apply isort on py files * Fix circular import * Fix format for notebooks * Fix format --------- Co-authored-by: Chi Wang <wang.chi@microsoft.com>
28 lines
751 B
Python
28 lines
751 B
Python
import json
|
|
import os
|
|
import sys
|
|
|
|
from autogenbench.tabulate_cmd import default_tabulate
|
|
|
|
|
|
def scorer(instance_dir):
|
|
checker_messages = os.path.join(instance_dir, "checker_messages.json")
|
|
if os.path.isfile(checker_messages):
|
|
with open(checker_messages, "rt") as fh:
|
|
messages = json.loads(fh.read())["checker_proxy"]
|
|
results = messages[-1]["content"].lower()
|
|
if "the answer is correct" in results or "the answer is approximated but should be correct" in results:
|
|
return True
|
|
else:
|
|
return False
|
|
else:
|
|
return None
|
|
|
|
|
|
def main(args):
|
|
default_tabulate(args, scorer=scorer)
|
|
|
|
|
|
if __name__ == "__main__" and __package__ is None:
|
|
main(sys.argv)
|