pragneshbarik commited on
Commit
d466514
1 Parent(s): ac9e241

added doc string to function rerank and gen_augmented_prompt_via_websearch

Browse files
Files changed (1) hide show
  1. utils.py +16 -15
utils.py CHANGED
@@ -69,8 +69,8 @@ def gen_augmented_prompt_via_websearch(
69
  vendor,
70
  n_crawl,
71
  top_k,
72
- pre_context,
73
- post_context,
74
  pre_prompt="",
75
  post_prompt="",
76
  pass_prev=False,
@@ -78,24 +78,25 @@ def gen_augmented_prompt_via_websearch(
78
  chunk_size=512,
79
  ):
80
  """
81
-
82
 
83
  Args:
84
- prompt (str, required):
85
- vendor ('Google'|'Bing'): enum
86
- n_crawl (int): _description_
87
- top_k (int): _description_
88
- pre_context (str): _description_
89
- post_context (str): _description_
90
- pre_prompt (str, optional): _description_. Defaults to "".
91
- post_prompt (str, optional): _description_. Defaults to "".
92
- pass_prev (bool, optional): _description_. Defaults to False.
93
- prev_output (str, optional): _description_. Defaults to "".
94
- chunk_size (int, optional): _description_. Defaults to 512.
95
 
96
  Returns:
97
- _type_: _description_
98
  """
 
99
  search_results = []
100
  if vendor == "Google":
101
  search_results = googleSearchClient.search(prompt, n_crawl)
 
69
  vendor,
70
  n_crawl,
71
  top_k,
72
+ pre_context="",
73
+ post_context="",
74
  pre_prompt="",
75
  post_prompt="",
76
  pass_prev=False,
 
78
  chunk_size=512,
79
  ):
80
  """
81
+ Generates an augmented prompt and a list of links by performing a web search and reranking the results.
82
 
83
  Args:
84
+ prompt (str, required): The prompt for the web search.
85
+ vendor (str): The search engine to use, either 'Google' or 'Bing'.
86
+ n_crawl (int): The number of search results to retrieve.
87
+ top_k (int): The number of top reranked results to return.
88
+ pre_context (str): The pre-context to be included in the augmented prompt.
89
+ post_context (str): The post-context to be included in the augmented prompt.
90
+ pre_prompt (str, optional): The pre-prompt to be included in the augmented prompt. Defaults to "".
91
+ post_prompt (str, optional): The post-prompt to be included in the augmented prompt. Defaults to "".
92
+ pass_prev (bool, optional): Whether to include the previous output in the augmented prompt. Defaults to False.
93
+ prev_output (str, optional): The previous output to be included in the augmented prompt. Defaults to "".
94
+ chunk_size (int, optional): The size of each chunk for reranking. Defaults to 512.
95
 
96
  Returns:
97
+ tuple: A tuple containing the augmented prompt and a list of links.
98
  """
99
+
100
  search_results = []
101
  if vendor == "Google":
102
  search_results = googleSearchClient.search(prompt, n_crawl)