Spaces:
Sleeping
Sleeping
Commit
·
cbcd5da
1
Parent(s):
d0c6f49
Update app.py
Browse files
app.py
CHANGED
@@ -18,12 +18,19 @@ def openai_chat(prompt):
|
|
18 |
)
|
19 |
message = completions.choices[0].text
|
20 |
return message.strip()
|
21 |
-
|
22 |
-
def chatbot(
|
23 |
-
|
24 |
-
|
|
|
25 |
return history, history
|
26 |
|
27 |
-
gr.Interface(fn=chatbot,
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
outputs = ["chatbot",'state'],
|
29 |
allow_flagging="manual").launch()
|
|
|
18 |
)
|
19 |
message = completions.choices[0].text
|
20 |
return message.strip()
|
21 |
+
|
22 |
+
def chatbot(input, history=[]):
|
23 |
+
input = sentence_builder
|
24 |
+
output = openai_chat(input)
|
25 |
+
history.append((input, output))
|
26 |
return history, history
|
27 |
|
28 |
+
gr.Interface(fn=chatbot,
|
29 |
+
[
|
30 |
+
gr.Textbox(label="¿A donde queres ir?", lines=1, value="Roma"),
|
31 |
+
gr.Slider(1, 30, value=4),
|
32 |
+
gr.Dropdown(["solo/a", "amigos", "pareja", "familia"]),
|
33 |
+
gr.Dropdown(["puntos turisticos", "museos", "parques", "teatro", "trekking", "playas"], value=["puntos turisticos"], multiselect=True),
|
34 |
+
],
|
35 |
outputs = ["chatbot",'state'],
|
36 |
allow_flagging="manual").launch()
|