Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -58,15 +58,15 @@ from datetime import datetime
|
|
58 |
#====================================SETUP=====================================#
|
59 |
# Fetch secrets from Hugging Face Spaces
|
60 |
api_key = os.environ["API_KEY"]
|
61 |
-
print(f"api_key::{api_key}")
|
62 |
endpoint = os.environ["OPENAI_API_BASE"]
|
63 |
-
print(f"endpoint::{endpoint}" )
|
64 |
groq_api_key = os.environ['LLAMA_API_KEY'] # llama_api_key = os.environ['GROQ_API_KEY']
|
65 |
-
print(f"groq_api_key::{groq_api_key}")
|
66 |
MEM0_api_key = os.environ['MEM0_API_KEY'] # MEM0_api_key = os.environ['mem0']
|
67 |
-
print(f"MEM0_api_key::{MEM0_api_key}")
|
68 |
my_api_key = os.environ["MY_API_KEY"]
|
69 |
-
print(f"my_api_key::{my_api_key}")
|
70 |
|
71 |
# Initialize the OpenAI embedding function for Chroma
|
72 |
embedding_function = chromadb.utils.embedding_functions.OpenAIEmbeddingFunction(
|
@@ -781,7 +781,7 @@ def nutrition_disorder_streamlit():
|
|
781 |
else:
|
782 |
st.write("In st.session_state...")
|
783 |
|
784 |
-
st.write("Getting response
|
785 |
response = st.session_state.chatbot.handle_customer_query(st.session_state.user_id, user_query)
|
786 |
st.write(f"Got response: {response}")
|
787 |
# Blank #7: Fill in with the method to handle queries (e.g., handle_customer_query)
|
|
|
58 |
#====================================SETUP=====================================#
|
59 |
# Fetch secrets from Hugging Face Spaces
|
60 |
api_key = os.environ["API_KEY"]
|
61 |
+
#print(f"api_key::{api_key}")
|
62 |
endpoint = os.environ["OPENAI_API_BASE"]
|
63 |
+
#print(f"endpoint::{endpoint}" )
|
64 |
groq_api_key = os.environ['LLAMA_API_KEY'] # llama_api_key = os.environ['GROQ_API_KEY']
|
65 |
+
#print(f"groq_api_key::{groq_api_key}")
|
66 |
MEM0_api_key = os.environ['MEM0_API_KEY'] # MEM0_api_key = os.environ['mem0']
|
67 |
+
#print(f"MEM0_api_key::{MEM0_api_key}")
|
68 |
my_api_key = os.environ["MY_API_KEY"]
|
69 |
+
#print(f"my_api_key::{my_api_key}")
|
70 |
|
71 |
# Initialize the OpenAI embedding function for Chroma
|
72 |
embedding_function = chromadb.utils.embedding_functions.OpenAIEmbeddingFunction(
|
|
|
781 |
else:
|
782 |
st.write("In st.session_state...")
|
783 |
|
784 |
+
st.write(f"Getting response...\nSession state: {st.session_state.user_id}\nUser query: {user_query}")
|
785 |
response = st.session_state.chatbot.handle_customer_query(st.session_state.user_id, user_query)
|
786 |
st.write(f"Got response: {response}")
|
787 |
# Blank #7: Fill in with the method to handle queries (e.g., handle_customer_query)
|