Update app.py
Browse files
app.py
CHANGED
@@ -50,18 +50,20 @@ def query_vectara(question, chat_history, uploaded_file):
|
|
50 |
api_endpoint = "https://api.vectara.io/v1/query"
|
51 |
return f"{upload_status}\n\nResponse from Vectara API: {response.text}"
|
52 |
|
53 |
-
|
|
|
54 |
iface = gr.Interface(
|
55 |
fn=query_vectara,
|
56 |
-
inputs=[gr.File(label="Upload a file")],
|
|
|
57 |
examples=["Hello", "What is the weather today?", "Tell me a joke"],
|
58 |
title="Vectara Chatbot",
|
59 |
description="Ask me anything using the Vectara API!",
|
60 |
-
submit="Send",
|
61 |
-
stop="Stop",
|
62 |
-
retry="Retry",
|
63 |
-
undo="Undo",
|
64 |
-
clear="Clear",
|
65 |
autofocus=True
|
66 |
)
|
67 |
|
|
|
50 |
api_endpoint = "https://api.vectara.io/v1/query"
|
51 |
return f"{upload_status}\n\nResponse from Vectara API: {response.text}"
|
52 |
|
53 |
+
|
54 |
+
# Create a Gradio ChatInterface with a text input, a file upload input, and a text output
|
55 |
iface = gr.Interface(
|
56 |
fn=query_vectara,
|
57 |
+
inputs=[gr.Textbox(default="Type your message here", label="Input Text"), gr.File(label="Upload a file")],
|
58 |
+
outputs=gr.Textbox(default="Response will appear here", label="Output Text"),
|
59 |
examples=["Hello", "What is the weather today?", "Tell me a joke"],
|
60 |
title="Vectara Chatbot",
|
61 |
description="Ask me anything using the Vectara API!",
|
62 |
+
submit="Send",
|
63 |
+
stop="Stop",
|
64 |
+
retry="Retry",
|
65 |
+
undo="Undo",
|
66 |
+
clear="Clear",
|
67 |
autofocus=True
|
68 |
)
|
69 |
|