more tool probes

This commit is contained in:
2023-02-28 14:29:24 +01:00
parent 9767c37ea3
commit f94b105872

View File

@@ -39,15 +39,30 @@ probes = {
"prompt": 'Tell me the date, you must run the following command in the terminal to do so: date "%A %H:%M"', "prompt": 'Tell me the date, you must run the following command in the terminal to do so: date "%A %H:%M"',
"validation": lambda res: [key in res for key in dt.datetime.now().strftime("%A %H").split(" ")] "validation": lambda res: [key in res for key in dt.datetime.now().strftime("%A %H").split(" ")]
} }
],
"python_repl": [
{
"prompt": "Tell me the date, you must run the following command Python to do so: print(datetime.datetime.now().strftime('%A %H'))",
"validation": lambda res: [key in res for key in dt.datetime.now().strftime("%A %H").split(" ")]
}
] ]
} }
results = { results = {
"requests": [], "requests": [],
"terminal": [] "terminal": [],
"python_repl": []
} }
if __name__ == "__main__": if __name__ == "__main__":
# create a cli flagging tool
import argparse
parser = argparse.ArgumentParser()
# add a flag to specify the probe
parser.add_argument('--probe', type=str, default='requests', choices=probes.keys())
# restrict probes variable to the probe specified if any
probes = {k: v for k, v in probes.items() if k == parser.parse_args().probe}
# for each probe type # for each probe type
for probe_type in probes: for probe_type in probes:
# for each probe # for each probe