diff --git a/factcheck/core/Retriever/SerperEvidenceRetrieve.py b/factcheck/core/Retriever/SerperEvidenceRetrieve.py index 657f9bc..3fd9074 100644 --- a/factcheck/core/Retriever/SerperEvidenceRetrieve.py +++ b/factcheck/core/Retriever/SerperEvidenceRetrieve.py @@ -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()) \ No newline at end of file