Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -604,7 +604,13 @@ def filter_input_with_llama_guard(user_input, model="llama-guard-3-8b"):
|
|
604 |
class NutritionBot:
|
605 |
def __init__(self):
|
606 |
# Initialize a memory client to store and retrieve customer interactions
|
607 |
-
self.memory = MemoryClient(os.environ["mem0"]) # Complete the code to define the memory client API key
|
|
|
|
|
|
|
|
|
|
|
|
|
608 |
#self.memory = MemoryClient(api_key=userdata.get("mem0")) # Complete the code to define the memory client API key
|
609 |
# Initialize the Azure OpenAI client using the provided credentials
|
610 |
self.client = AzureChatOpenAI(
|
|
|
604 |
class NutritionBot:
|
605 |
def __init__(self):
|
606 |
# Initialize a memory client to store and retrieve customer interactions
|
607 |
+
#self.memory = MemoryClient(os.environ["mem0"]) # Complete the code to define the memory client API key
|
608 |
+
try:
|
609 |
+
self.memory = MemoryClient(os.environ["mem0"])
|
610 |
+
except Exception as e:
|
611 |
+
st.error(f"Failed to initialize MemoryClient: {e}")
|
612 |
+
raise
|
613 |
+
|
614 |
#self.memory = MemoryClient(api_key=userdata.get("mem0")) # Complete the code to define the memory client API key
|
615 |
# Initialize the Azure OpenAI client using the provided credentials
|
616 |
self.client = AzureChatOpenAI(
|