Files
Auto-GPT/agbenchmark/challenges/retrieval/r1/r1_test.py
2023-07-02 16:14:49 -04:00

24 lines
775 B
Python

import os
from typing import Any, Dict
from agbenchmark.challenges.retrieval.retrieval import RetrievalChallenge
class TestRetrieval1(RetrievalChallenge):
"""The first information-retrieval challenge"""
def get_file_path(self) -> str: # all tests must implement this method
return os.path.join(os.path.dirname(__file__), "r1_data.json")
def test_method(self, config: Dict[str, Any]) -> None:
self.setup_challenge(config)
files_contents = self.open_files(config["workspace"], self.data.ground.files)
scores = []
for file_content in files_contents:
score = self.scoring(file_content, self.data.ground)
print("Your score is:", score)
scores.append(score)
assert 1 in scores