Skip to content

Commit

Permalink
added testing for Serper
Browse files Browse the repository at this point in the history
  • Loading branch information
HanXudong committed Apr 19, 2024
1 parent b7d4dfc commit 818f457
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions factcheck/core/Retriever/SerperEvidenceRetrieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,16 @@ def _request_serper_api(self, questions):
else:
raise Exception(f"Error occurred: {response.text}")

if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--serper_api_key", type=str, help="API key for serper")
args = parser.parse_args()

api_config = {
"SERPER_API_KEY": args.serper_api_key
}
retriever = SerperEvidenceRetrieve(api_config)

result = retriever._request_serper_api(["Apple", "IBM"])
print(result.json())

0 comments on commit 818f457

Please sign in to comment.