Spaces:
Running
Running
Update helper_functions_api.py
Browse files- helper_functions_api.py +1 -1
helper_functions_api.py
CHANGED
@@ -242,7 +242,7 @@ def fetch_and_extract_content(data_format, urls, query):
|
|
242 |
def search_brave(query, num_results=5):
|
243 |
cleaned_query = query #re.sub(r'[^a-zA-Z0-9]+', '', query)
|
244 |
search_query = together_response(cleaned_query, model=llm_default_small, SysPrompt=SysPromptSearch, max_tokens = 25).strip()
|
245 |
-
cleaned_search_query = search_query #re.sub(r'[^a-zA-Z0-9*]+', '', search_query)
|
246 |
brave = Brave(BRAVE_API_KEY)
|
247 |
search_results = brave.search(q=cleaned_search_query, count=num_results)
|
248 |
return [url.__str__() for url in search_results.urls],cleaned_search_query
|
|
|
242 |
def search_brave(query, num_results=5):
|
243 |
cleaned_query = query #re.sub(r'[^a-zA-Z0-9]+', '', query)
|
244 |
search_query = together_response(cleaned_query, model=llm_default_small, SysPrompt=SysPromptSearch, max_tokens = 25).strip()
|
245 |
+
cleaned_search_query = re.sub(r'[^\w\s]', '', search_query).strip() #re.sub(r'[^a-zA-Z0-9*]+', '', search_query)
|
246 |
brave = Brave(BRAVE_API_KEY)
|
247 |
search_results = brave.search(q=cleaned_search_query, count=num_results)
|
248 |
return [url.__str__() for url in search_results.urls],cleaned_search_query
|