From c0ca4470417b8d73f21633bf0ec295961830bfd2 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 12 Jun 2024 01:37:53 -0700 Subject: [PATCH] chore: format --- backend/apps/rag/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/apps/rag/main.py b/backend/apps/rag/main.py index d7301acd6..113e60ea8 100644 --- a/backend/apps/rag/main.py +++ b/backend/apps/rag/main.py @@ -717,7 +717,7 @@ def validate_url(url: Union[str, Sequence[str]]): if isinstance(validators.url(url), validators.ValidationError): raise ValueError(ERROR_MESSAGES.INVALID_URL) if not ENABLE_RAG_LOCAL_WEB_FETCH: - # Check if the URL exists by making a HEAD request + # Check if the URL exists by making a HEAD request try: response = requests.head(url, allow_redirects=True) if response.status_code != 200: @@ -730,6 +730,7 @@ def validate_url(url: Union[str, Sequence[str]]): else: return False + def search_web(engine: str, query: str) -> list[SearchResult]: """Search the web using a search engine and return the results as a list of SearchResult objects. Will look for a search engine API key in environment variables in the following order: