Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,16 +69,15 @@ def ground_search(prompt):
|
|
| 69 |
|
| 70 |
#api_key = os.getenv('groq')
|
| 71 |
google_api_key = os.getenv('google_search')
|
| 72 |
-
API_URL = "https://blavken-flowiseblav.hf.space/api/v1/prediction/fbc118dc-ec00-4b59-acff-600648958be3"
|
| 73 |
|
| 74 |
def query(payload):
|
| 75 |
-
|
| 76 |
-
|
|
|
|
| 77 |
|
| 78 |
def querys(payloads):
|
| 79 |
-
output = query({
|
| 80 |
-
"question": f"{payloads}",
|
| 81 |
-
})
|
| 82 |
print(output)
|
| 83 |
#return result_text
|
| 84 |
|
|
@@ -145,7 +144,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 145 |
button = gr.Button("Senden")
|
| 146 |
|
| 147 |
# Connect the button to the function
|
| 148 |
-
button.click(fn=
|
| 149 |
|
| 150 |
# Launch the Gradio application
|
| 151 |
demo.launch()
|
|
|
|
| 69 |
|
| 70 |
#api_key = os.getenv('groq')
|
| 71 |
google_api_key = os.getenv('google_search')
|
| 72 |
+
#API_URL = "https://blavken-flowiseblav.hf.space/api/v1/prediction/fbc118dc-ec00-4b59-acff-600648958be3"
|
| 73 |
|
| 74 |
def query(payload):
|
| 75 |
+
API_URL = f"https://www.bing.com/search?q={payload}"
|
| 76 |
+
response = requests.get(API_URL)
|
| 77 |
+
return response.text()
|
| 78 |
|
| 79 |
def querys(payloads):
|
| 80 |
+
output = query(f"{payloads}")
|
|
|
|
|
|
|
| 81 |
print(output)
|
| 82 |
#return result_text
|
| 83 |
|
|
|
|
| 144 |
button = gr.Button("Senden")
|
| 145 |
|
| 146 |
# Connect the button to the function
|
| 147 |
+
button.click(fn=querys, inputs=ort_input, outputs=details_output)
|
| 148 |
|
| 149 |
# Launch the Gradio application
|
| 150 |
demo.launch()
|