Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -126,8 +126,11 @@ def rag(input_text, history, jezik, file):
|
|
| 126 |
# return query_engine.query(input_text)
|
| 127 |
# return history.append({"role": "assistant", "content": query_engine.query(input_text)})
|
| 128 |
return history.append(
|
| 129 |
-
ChatMessage(role="
|
| 130 |
-
|
|
|
|
|
|
|
|
|
|
| 131 |
)
|
| 132 |
)
|
| 133 |
# collection.add(
|
|
@@ -168,7 +171,7 @@ def rag(input_text, history, jezik, file):
|
|
| 168 |
iface = gr.ChatInterface(rag,
|
| 169 |
title="UChat",
|
| 170 |
description="Postavite pitanje ili opišite problem koji imate",
|
| 171 |
-
chatbot=gr.Chatbot(
|
| 172 |
textbox=gr.Textbox(placeholder="Pitanje ili opis problema", container=False, scale=7),
|
| 173 |
theme="soft",
|
| 174 |
# examples=["Ne radi mi internet", "Koje usluge imam na raspologanju?", "Ne radi mi daljinski upravljač, šta da radim?"],
|
|
|
|
| 126 |
# return query_engine.query(input_text)
|
| 127 |
# return history.append({"role": "assistant", "content": query_engine.query(input_text)})
|
| 128 |
return history.append(
|
| 129 |
+
ChatMessage(role="user",
|
| 130 |
+
content=input_text
|
| 131 |
+
).append(
|
| 132 |
+
role="assistant",
|
| 133 |
+
content=query_engine.query(input_text)
|
| 134 |
)
|
| 135 |
)
|
| 136 |
# collection.add(
|
|
|
|
| 171 |
iface = gr.ChatInterface(rag,
|
| 172 |
title="UChat",
|
| 173 |
description="Postavite pitanje ili opišite problem koji imate",
|
| 174 |
+
chatbot=gr.Chatbot(ChatMessage(role="assistant", content="Kako Vam mogu pomoći?"), type="messages", label="UChat", height=300),
|
| 175 |
textbox=gr.Textbox(placeholder="Pitanje ili opis problema", container=False, scale=7),
|
| 176 |
theme="soft",
|
| 177 |
# examples=["Ne radi mi internet", "Koje usluge imam na raspologanju?", "Ne radi mi daljinski upravljač, šta da radim?"],
|