Spaces:
Runtime error
Runtime error
Kushwanth Chowday Kandala
commited on
TypeError: 'NoneType' object is not callable bug test
Browse files
app.py
CHANGED
|
@@ -87,13 +87,16 @@ def chat_actions():
|
|
| 87 |
query_vector = query_embedding.tolist()
|
| 88 |
# now query vector database
|
| 89 |
result = index.query(query_vector, top_k=5, include_metadata=True) # xc is a list of tuples
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
|
| 99 |
if "chat_history" not in st.session_state:
|
|
|
|
| 87 |
query_vector = query_embedding.tolist()
|
| 88 |
# now query vector database
|
| 89 |
result = index.query(query_vector, top_k=5, include_metadata=True) # xc is a list of tuples
|
| 90 |
+
with st.sidebar:
|
| 91 |
+
st.json(result)
|
| 92 |
+
|
| 93 |
+
for result in xc['matches']:
|
| 94 |
+
st.session_state["chat_history"].append(
|
| 95 |
+
{
|
| 96 |
+
"role": "assistant",
|
| 97 |
+
"content": f"{round(result['score'],2)}: {result['metadata']['text']}",
|
| 98 |
+
}, # This can be replaced with your chat response logic
|
| 99 |
+
)
|
| 100 |
|
| 101 |
|
| 102 |
if "chat_history" not in st.session_state:
|