Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import gradio as gr
|
2 |
-
from googlesearch import search
|
3 |
import requests
|
4 |
from bs4 import BeautifulSoup
|
5 |
from gradio_client import Client
|
@@ -13,7 +12,6 @@ import os
|
|
13 |
api_key = os.getenv('groq')
|
14 |
client = groq.Client(api_key=api_key)
|
15 |
|
16 |
-
|
17 |
def llm(message):
|
18 |
message = f"return a json object with the keys: name,email,phone,website \n the values can be found here, leave blank if value is not available:\n {message} \n return a json object only. no text, no explanaition"
|
19 |
try:
|
@@ -85,18 +83,18 @@ def process_ort(ort):
|
|
85 |
vereine.append(json_object)
|
86 |
|
87 |
# Convert JSON string to Python dictionary
|
88 |
-
data_dict = json.loads(vereine)
|
89 |
# Convert dictionary to DataFrame
|
90 |
-
df = pd.DataFrame(data_dict)
|
91 |
|
92 |
-
return df
|
93 |
return vereine
|
94 |
|
95 |
demo = gr.Interface(
|
96 |
fn=process_ort,
|
|
|
97 |
inputs=gr.Textbox(lines=1, placeholder="Geben Sie Ihre Suchanfrage ein..."),
|
98 |
-
#outputs="text",
|
99 |
-
outputs=gr.DataFrame(label="Ausgabe"),
|
100 |
title="# google websearch",
|
101 |
description="Geben Sie eine Suchanfrage ein..."
|
102 |
)
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import requests
|
3 |
from bs4 import BeautifulSoup
|
4 |
from gradio_client import Client
|
|
|
12 |
api_key = os.getenv('groq')
|
13 |
client = groq.Client(api_key=api_key)
|
14 |
|
|
|
15 |
def llm(message):
|
16 |
message = f"return a json object with the keys: name,email,phone,website \n the values can be found here, leave blank if value is not available:\n {message} \n return a json object only. no text, no explanaition"
|
17 |
try:
|
|
|
83 |
vereine.append(json_object)
|
84 |
|
85 |
# Convert JSON string to Python dictionary
|
86 |
+
#data_dict = json.loads(vereine)
|
87 |
# Convert dictionary to DataFrame
|
88 |
+
#df = pd.DataFrame(data_dict)
|
89 |
|
90 |
+
#return df
|
91 |
return vereine
|
92 |
|
93 |
demo = gr.Interface(
|
94 |
fn=process_ort,
|
95 |
+
outputs=gr.Markdown(label="# Ausgabe"),
|
96 |
inputs=gr.Textbox(lines=1, placeholder="Geben Sie Ihre Suchanfrage ein..."),
|
97 |
+
#outputs="text",
|
|
|
98 |
title="# google websearch",
|
99 |
description="Geben Sie eine Suchanfrage ein..."
|
100 |
)
|