Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -23,6 +23,17 @@ custom_css = """
|
|
23 |
|
24 |
#api_key = os.getenv('groq')
|
25 |
google_api_key = os.getenv('google_search')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
#very simple (and extremly fast) websearch
|
28 |
def websearch(prompt):
|
@@ -77,7 +88,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
77 |
button = gr.Button("Senden")
|
78 |
|
79 |
# Connect the button to the function
|
80 |
-
button.click(fn=
|
81 |
|
82 |
# Launch the Gradio application
|
83 |
demo.launch()
|
|
|
23 |
|
24 |
#api_key = os.getenv('groq')
|
25 |
google_api_key = os.getenv('google_search')
|
26 |
+
API_URL = "https://blavken-flowiseblav.hf.space/api/v1/prediction/fbc118dc-ec00-4b59-acff-600648958be3"
|
27 |
+
|
28 |
+
def query(payload):
|
29 |
+
response = requests.post(API_URL, json=payload)
|
30 |
+
return response.json()
|
31 |
+
|
32 |
+
def querys(payloads):
|
33 |
+
output = query({
|
34 |
+
"question": f"{payloads}",
|
35 |
+
})
|
36 |
+
return output
|
37 |
|
38 |
#very simple (and extremly fast) websearch
|
39 |
def websearch(prompt):
|
|
|
88 |
button = gr.Button("Senden")
|
89 |
|
90 |
# Connect the button to the function
|
91 |
+
button.click(fn=querys, inputs=ort_input, outputs=details_output)
|
92 |
|
93 |
# Launch the Gradio application
|
94 |
demo.launch()
|