@@ -314,10 +314,11 @@ def search_google_and_summarize(query: str) -> str:
314
314
return "Failed to find the answer from google search."
315
315
316
316
317
- def search_wolfram_alpha (query : str , is_detailed : bool ) -> str :
318
- r"""Queries Wolfram|Alpha and returns the result. Wolfram|Alpha is a
319
- search engine that uses algorithms, knowledgebase and AI to compute
320
- expert-level answers for math, science, society, everyday life and more.
317
+ def query_wolfram_alpha (query : str , is_detailed : bool ) -> str :
318
+ r"""Queries Wolfram|Alpha and returns the result. Wolfram|Alpha is an
319
+ answer engine developed by Wolfram Research. It is offered as an online
320
+ service that answers factual queries by computing answers from externally
321
+ sourced data.
321
322
322
323
Args:
323
324
query (str): The query to send to Wolfram Alpha.
@@ -331,8 +332,7 @@ def search_wolfram_alpha(query: str, is_detailed: bool) -> str:
331
332
import wolframalpha
332
333
except ImportError :
333
334
raise ImportError (
334
- "Please install `wolframalpha` first. You can install it by "
335
- "running `pip install wolframalpha`."
335
+ "Please install `wolframalpha` first. You can install it by running `pip install wolframalpha`."
336
336
)
337
337
338
338
WOLFRAMALPHA_APP_ID = os .environ .get ('WOLFRAMALPHA_APP_ID' )
@@ -370,5 +370,5 @@ def search_wolfram_alpha(query: str, is_detailed: bool) -> str:
370
370
371
371
SEARCH_FUNCS : List [OpenAIFunction ] = [
372
372
OpenAIFunction (func ) # type: ignore[arg-type]
373
- for func in [search_wiki , search_google_and_summarize , search_wolfram_alpha ]
373
+ for func in [search_wiki , search_google_and_summarize , query_wolfram_alpha ]
374
374
]
0 commit comments