mgokg commited on
Commit
201f13e
·
verified ·
1 Parent(s): aee6311

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -3,10 +3,8 @@ import requests
3
  from bs4 import BeautifulSoup
4
  from urllib.parse import urljoin
5
 
6
- def parse_links(ort):
7
  try:
8
- import requests
9
-
10
  url = "http://specialist-it.de:3001/api/search"
11
 
12
  payload = {
@@ -20,7 +18,7 @@ def parse_links(ort):
20
  },
21
  "optimizationMode": "balanced",
22
  "focusMode": "webSearch",
23
- "query": f"{ort}",
24
  "history": [
25
  ["human", "Hi, how are you?"],
26
  ["assistant", "I am doing well, how can I help you today?"]
@@ -46,7 +44,7 @@ def parse_links(ort):
46
  # Erstelle die Gradio-Schnittstelle
47
  with gr.Blocks() as demo:
48
  gr.Markdown("# Perplexica WebSearch")
49
- ort_input = gr.Textbox(label="Ort", placeholder="prompt")
50
  links_output = gr.JSON(label="Antwort")
51
  # Button zum Starten der Parsung
52
  button = gr.Button("senden")
 
3
  from bs4 import BeautifulSoup
4
  from urllib.parse import urljoin
5
 
6
+ def parse_links(prompt):
7
  try:
 
 
8
  url = "http://specialist-it.de:3001/api/search"
9
 
10
  payload = {
 
18
  },
19
  "optimizationMode": "balanced",
20
  "focusMode": "webSearch",
21
+ "query": f"{prompt}. output format=json",
22
  "history": [
23
  ["human", "Hi, how are you?"],
24
  ["assistant", "I am doing well, how can I help you today?"]
 
44
  # Erstelle die Gradio-Schnittstelle
45
  with gr.Blocks() as demo:
46
  gr.Markdown("# Perplexica WebSearch")
47
+ ort_input = gr.Textbox(label="Prompt", placeholder="prompt")
48
  links_output = gr.JSON(label="Antwort")
49
  # Button zum Starten der Parsung
50
  button = gr.Button("senden")