LewisBabong commited on
Commit
4052b17
·
verified ·
1 Parent(s): da25611

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -2,16 +2,16 @@ import streamlit as st
2
  import requests
3
  import tempfile
4
  import uuid
5
- from groq import Groq
6
  import os
 
7
  from langsmith import Client as LangSmithClient
8
  import time
9
 
 
10
  HF_TOKEN = f"Bearer {os.getenv('HF_TOKEN_SECRET')}"
11
  GROQ_API_KEY = os.getenv("GROQ_API_KEY")
12
  LANGSMITH_API_KEY = os.getenv("LANGSMITH_API_KEY")
13
 
14
-
15
  groq_client = Groq(api_key=GROQ_API_KEY)
16
  langsmith_client = LangSmithClient(api_key=LANGSMITH_API_KEY)
17
 
@@ -370,7 +370,7 @@ with st.sidebar:
370
  if 'chat_history' not in st.session_state:
371
  st.session_state.chat_history = []
372
  if 'conversation_id' not in st.session_state:
373
- st.session_state.conversation_id = str(uuid4())
374
  if 'chat_open' not in st.session_state:
375
  st.session_state.chat_open = False
376
 
@@ -453,7 +453,7 @@ with st.container():
453
  with col2:
454
  if st.button("Effacer"):
455
  st.session_state.chat_history = []
456
- st.session_state.conversation_id = str(uuid4())
457
  st.rerun()
458
  st.markdown('</div>', unsafe_allow_html=True)
459
  st.markdown('</div>', unsafe_allow_html=True)
 
2
  import requests
3
  import tempfile
4
  import uuid
 
5
  import os
6
+ from groq import Groq
7
  from langsmith import Client as LangSmithClient
8
  import time
9
 
10
+
11
  HF_TOKEN = f"Bearer {os.getenv('HF_TOKEN_SECRET')}"
12
  GROQ_API_KEY = os.getenv("GROQ_API_KEY")
13
  LANGSMITH_API_KEY = os.getenv("LANGSMITH_API_KEY")
14
 
 
15
  groq_client = Groq(api_key=GROQ_API_KEY)
16
  langsmith_client = LangSmithClient(api_key=LANGSMITH_API_KEY)
17
 
 
370
  if 'chat_history' not in st.session_state:
371
  st.session_state.chat_history = []
372
  if 'conversation_id' not in st.session_state:
373
+ st.session_state.conversation_id = str(uuid.uuid4())
374
  if 'chat_open' not in st.session_state:
375
  st.session_state.chat_open = False
376
 
 
453
  with col2:
454
  if st.button("Effacer"):
455
  st.session_state.chat_history = []
456
+ st.session_state.conversation_id = str(uuid.uuid4())
457
  st.rerun()
458
  st.markdown('</div>', unsafe_allow_html=True)
459
  st.markdown('</div>', unsafe_allow_html=True)