Spaces:
Running
Running
Update helper_functions_api.py
Browse files- helper_functions_api.py +2 -2
helper_functions_api.py
CHANGED
@@ -231,9 +231,9 @@ def fetch_and_extract_content(data_format, urls, query):
|
|
231 |
|
232 |
@retry(tries=3, delay=0.25)
|
233 |
def search_brave(query, num_results=5):
|
234 |
-
cleaned_query = re.sub(r'[^a-zA-Z0-9]+', '', query)
|
235 |
search_query = together_response(cleaned_query, model=llm_default_small, SysPrompt=SysPromptSearch, max_tokens = 25).strip()
|
236 |
-
cleaned_search_query = re.sub(r'[^a-zA-Z0-9*]+', '', search_query)
|
237 |
brave = Brave(BRAVE_API_KEY)
|
238 |
search_results = brave.search(q=cleaned_search_query, count=num_results)
|
239 |
return [url.__str__() for url in search_results.urls],cleaned_search_query
|
|
|
231 |
|
232 |
@retry(tries=3, delay=0.25)
|
233 |
def search_brave(query, num_results=5):
|
234 |
+
cleaned_query = query #re.sub(r'[^a-zA-Z0-9]+', '', query)
|
235 |
search_query = together_response(cleaned_query, model=llm_default_small, SysPrompt=SysPromptSearch, max_tokens = 25).strip()
|
236 |
+
cleaned_search_query = query #re.sub(r'[^a-zA-Z0-9*]+', '', search_query)
|
237 |
brave = Brave(BRAVE_API_KEY)
|
238 |
search_results = brave.search(q=cleaned_search_query, count=num_results)
|
239 |
return [url.__str__() for url in search_results.urls],cleaned_search_query
|