leo-bourrel commited on
Commit
f419f72
·
1 Parent(s): 169e727

feat: allow chat history in dev environment

Browse files
Files changed (2) hide show
  1. app.py +3 -2
  2. vector_store.py +0 -1
app.py CHANGED
@@ -75,8 +75,9 @@ def send_message_callback():
75
  )
76
  )
77
  st.session_state.token_count += cb.total_tokens
78
- # history_id = insert_chat_history(conn, human_prompt, llm_response["answer"])
79
- # insert_chat_history_articles(conn, history_id, llm_response["source_documents"])
 
80
 
81
 
82
  def exemple_message_callback_button(args):
 
75
  )
76
  )
77
  st.session_state.token_count += cb.total_tokens
78
+ if os.environ.get("ENVIRONMENT") == "dev":
79
+ history_id = insert_chat_history(conn, human_prompt, llm_response["answer"])
80
+ insert_chat_history_articles(conn, history_id, llm_response["source_documents"])
81
 
82
 
83
  def exemple_message_callback_button(args):
vector_store.py CHANGED
@@ -246,7 +246,6 @@ class CustomVectorStore(VectorStore):
246
  ]
247
  return docs
248
 
249
-
250
  def __query_collection(
251
  self,
252
  embedding: List[float],
 
246
  ]
247
  return docs
248
 
 
249
  def __query_collection(
250
  self,
251
  embedding: List[float],