henryhyunwookim commited on
Commit
dc8f606
·
verified ·
1 Parent(s): 58ceb7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -6,7 +6,7 @@ from langchain_google_genai import ChatGoogleGenerativeAI
6
  from utils.utils import summarize_search_result, get_prompt
7
 
8
 
9
- def main(search_query, search_location, serp_api_key, google_api_key):
10
  search_response = serpapi.search(
11
  q=search_query,
12
  location=search_location,
@@ -17,7 +17,6 @@ def main(search_query, search_location, serp_api_key, google_api_key):
17
 
18
  prompt = get_prompt(search_query, search_summary)
19
 
20
- os.environ["GOOGLE_API_KEY"] = google_api_key
21
  chat_model = ChatGoogleGenerativeAI(
22
  model="gemini-pro",
23
  convert_system_message_to_human=True,
@@ -36,9 +35,8 @@ if __name__ == "__main__":
36
  inputs=[
37
  gr.Textbox(label="Search Query (検索クエリ)"),
38
  gr.Textbox(label="Search Location (検索を行う国を英語で入力してください)"),
39
- gr.Textbox(label="SERP API Key (https://serpapi.com/manage-api-key)"),
40
- gr.Textbox(label="Google API Key (https://console.cloud.google.com/apis/credentials)")
41
- ],
42
  outputs=[gr.Textbox(label="Search Result (検索結果)")],
43
  title="Google Search enhanced by LLM"
44
  )
 
6
  from utils.utils import summarize_search_result, get_prompt
7
 
8
 
9
+ def main(search_query, search_location, serp_api_key):
10
  search_response = serpapi.search(
11
  q=search_query,
12
  location=search_location,
 
17
 
18
  prompt = get_prompt(search_query, search_summary)
19
 
 
20
  chat_model = ChatGoogleGenerativeAI(
21
  model="gemini-pro",
22
  convert_system_message_to_human=True,
 
35
  inputs=[
36
  gr.Textbox(label="Search Query (検索クエリ)"),
37
  gr.Textbox(label="Search Location (検索を行う国を英語で入力してください)"),
38
+ gr.Textbox(label="SERP API Key (https://serpapi.com/manage-api-key)")
39
+ ],
 
40
  outputs=[gr.Textbox(label="Search Result (検索結果)")],
41
  title="Google Search enhanced by LLM"
42
  )