mgokg commited on
Commit
bc9917c
·
verified ·
1 Parent(s): 738f0eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -19
app.py CHANGED
@@ -8,31 +8,17 @@ from gradio_client import Client
8
 
9
 
10
  route="""
11
- Achtung! Diese Anweisungen gelten nur wenn eine Zugverbindung angefragt wird.
12
  how to handle special case "zugverbindung".
13
 
14
- Rolle: Du bist ein spezialisierter API-Handler für Reiseanfragen.
15
- Aufgabe: Identifiziere Anfragen zu Zugverbindungen und extrahiere Start- und Zielort.
16
-
17
  Regeln:
18
- Wenn eine Zugverbindung von {start_loc} nach {dest_loc} angefragt wird, antworte ausschließlich mit dem unten stehenden JSON-Objekt.
19
-
20
- Fülle die Werte für start_loc und dest_loc basierend auf der Benutzereingabe aus.
21
-
22
- Wichtig: Gib absolut keinen Text vor oder nach dem JSON aus (keine Erklärungen, kein "Hier ist das Ergebnis").
23
-
24
- Achte auf die korrekte Bezeichnung der Bahnhöfe (z.B. "Hbf", "Bahnhof").
25
-
26
- JSON-Format:
27
-
28
- JSON
29
 
30
  {
31
- "start_loc": "Eingabe Startort",
32
- "dest_loc": "Eingabe Zielort"
33
  }
34
 
35
- Beispiel: Eingabe: "Ich möchte mit dem Zug von Bad Kissingen Bahnhof nach Würzburg Hbf fahren.Ausgabe: {"start_loc": "Bad Kissingen Bahnhof", "dest_loc": "Würzburg Hbf"}
36
  """
37
 
38
 
@@ -72,7 +58,7 @@ def generate(input_text):
72
  types.Content(
73
  role="user",
74
  parts=[
75
- types.Part.from_text(text=f"input_text {route}"),
76
  ],
77
  ),
78
  ]
 
8
 
9
 
10
  route="""
 
11
  how to handle special case "zugverbindung".
12
 
 
 
 
13
  Regeln:
14
+ Wenn eine Zugverbindung von {Startort} nach {Zielort} angefragt wird, return json object with Startort and Zielort.
15
+ always follow json scheme below.
 
 
 
 
 
 
 
 
 
16
 
17
  {
18
+ "start_loc": "fill in Startort here",
19
+ "dest_loc": "fill in Zielort here"
20
  }
21
 
 
22
  """
23
 
24
 
 
58
  types.Content(
59
  role="user",
60
  parts=[
61
+ types.Part.from_text(text=f"{route} input_text "),
62
  ],
63
  ),
64
  ]