Update app.py
Browse files
app.py
CHANGED
@@ -6,11 +6,17 @@ import sys
|
|
6 |
import os
|
7 |
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
def chatbot(indexName, input_text):
|
10 |
"""
|
11 |
Chatbot function that takes in a prompt and returns a response
|
12 |
"""
|
13 |
-
index =
|
14 |
response = index.query(input_text, response_mode="compact")
|
15 |
return response.response
|
16 |
|
|
|
6 |
import os
|
7 |
|
8 |
|
9 |
+
cache = {}
|
10 |
+
cache.put("RetroFeedback", GPTSimpleVectorIndex.load_from_disk('RetroFeedback.json'))
|
11 |
+
cache.put("Snowflake", GPTSimpleVectorIndex.load_from_disk('Snowflake.json'))
|
12 |
+
cache.put("Datadog", GPTSimpleVectorIndex.load_from_disk('Datadog.json'))
|
13 |
+
cache.put("Databricks", GPTSimpleVectorIndex.load_from_disk('Databricks.json'))
|
14 |
+
|
15 |
def chatbot(indexName, input_text):
|
16 |
"""
|
17 |
Chatbot function that takes in a prompt and returns a response
|
18 |
"""
|
19 |
+
index = cache.get(indexName)
|
20 |
response = index.query(input_text, response_mode="compact")
|
21 |
return response.response
|
22 |
|