Update app.py
Browse filesupdate function and variable names
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import serpapi
|
|
| 3 |
import gradio as gr
|
| 4 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 5 |
|
| 6 |
-
from utils.utils import
|
| 7 |
|
| 8 |
|
| 9 |
def main(search_query, search_location, serp_api_key):
|
|
@@ -13,9 +13,9 @@ def main(search_query, search_location, serp_api_key):
|
|
| 13 |
api_key=serp_api_key
|
| 14 |
) # engine="google", location="Austin, Texas", hl="en", gl="us"
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
prompt = get_prompt(search_query,
|
| 19 |
|
| 20 |
chat_model = ChatGoogleGenerativeAI(
|
| 21 |
model="gemini-pro",
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 5 |
|
| 6 |
+
from utils.utils import get_top_results, get_prompt
|
| 7 |
|
| 8 |
|
| 9 |
def main(search_query, search_location, serp_api_key):
|
|
|
|
| 13 |
api_key=serp_api_key
|
| 14 |
) # engine="google", location="Austin, Texas", hl="en", gl="us"
|
| 15 |
|
| 16 |
+
top_results = get_top_results(search_response)
|
| 17 |
|
| 18 |
+
prompt = get_prompt(search_query, top_results)
|
| 19 |
|
| 20 |
chat_model = ChatGoogleGenerativeAI(
|
| 21 |
model="gemini-pro",
|