-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement - add prefilled testsets for apps created with template i…
…n demo version (#623) add pre-filled testsets to apps created from templates
- Loading branch information
Showing
4 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
agenta-backend/agenta_backend/resources/default_testsets/single_prompt_testsets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ | ||
{"country": "Nauru", "correct_answer": "The capital of Nauru is Funafuti"}, | ||
{"country": "Tuvalu", "correct_answer": "The capital of Tuvalu is Funafuti"}, | ||
{"country": "Brunei", "correct_answer": "The capital of Brunei is Bandar Seri Begawan"}, | ||
{"country": "Kiribati", "correct_answer": "The capital of Kiribati is Tarawa"}, | ||
{"country": "Comoros", "correct_answer": "The capital of Comoros is Moroni"}, | ||
{"country": "Kyrgyzstan", "correct_answer": "The capital of Kyrgyzstan is Bishkek"}, | ||
{"country": "Azerbaijan", "correct_answer": "The capital of Azerbaijan is Baku"} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
agenta-backend/agenta_backend/services/json_importer_helper.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import json | ||
|
||
|
||
def get_json(json_path: str): | ||
"""Reads and returns the contents of a JSON file as a list of | ||
dictionaries. | ||
Args: | ||
json_path (str): The path of json | ||
""" | ||
|
||
with open(json_path) as f: | ||
try: | ||
json_data = json.loads(f.read()) | ||
except Exception: | ||
raise ValueError(f"Could not read JSON file: {json_path}") | ||
return json_data |