jenngang commited on
Commit
f75800a
·
verified ·
1 Parent(s): 1508ee0

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -576,14 +576,15 @@ class NutritionBot:
576
  self.memory = MemoryClient(api_key=MEM0_api_key) # userdata.get("mem0")) # Complete the code to define the memory client API key
577
 
578
  #st.write(f"my_api_key:{my_api_key}")
 
579
  st.write(f"api_key:{api_key}")
580
  try:
581
  self.client = ChatOpenAI(
582
  model="gpt-4o",
583
  temperature=0.0,
584
  streaming=False, # Explicitly disabling streaming
585
- api_key=api_key,
586
- openai_api_key=api_key, # api_key
587
  #openai_api_base=endpoint # api_key
588
  )
589
  except Exception as e:
 
576
  self.memory = MemoryClient(api_key=MEM0_api_key) # userdata.get("mem0")) # Complete the code to define the memory client API key
577
 
578
  #st.write(f"my_api_key:{my_api_key}")
579
+ open_api_key = os.environ["OPENAI_API_KEY"]
580
  st.write(f"api_key:{api_key}")
581
  try:
582
  self.client = ChatOpenAI(
583
  model="gpt-4o",
584
  temperature=0.0,
585
  streaming=False, # Explicitly disabling streaming
586
+ api_key=open_api_key,
587
+ openai_api_key=open_api_key, # api_key
588
  #openai_api_base=endpoint # api_key
589
  )
590
  except Exception as e: