Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -571,7 +571,7 @@ class NutritionBot:
|
|
571 |
self.client = ChatOpenAI(
|
572 |
model_name="gpt-4o", # Specify the model to use (e.g., GPT-4 optimized version)
|
573 |
api_key = my_api_key, # config.get("API_KEY"), # API key for authentication
|
574 |
-
|
575 |
temperature=0 # Controls randomness in responses; 0 ensures deterministic results
|
576 |
)
|
577 |
|
@@ -767,7 +767,7 @@ def nutrition_disorder_streamlit():
|
|
767 |
if 'chatbot' not in st.session_state:
|
768 |
st.session_state.chatbot = NutritionBot() # Blank #6: Fill in with the chatbot class initialization (e.g., NutritionBot)
|
769 |
|
770 |
-
response = st.session_state.chatbot.handle_customer_query(st.session_state.user_id, user_query)
|
771 |
# Blank #7: Fill in with the method to handle queries (e.g., handle_customer_query)
|
772 |
st.write(response)
|
773 |
st.session_state.chat_history.append({"role": "assistant", "content": response})
|
|
|
571 |
self.client = ChatOpenAI(
|
572 |
model_name="gpt-4o", # Specify the model to use (e.g., GPT-4 optimized version)
|
573 |
api_key = my_api_key, # config.get("API_KEY"), # API key for authentication
|
574 |
+
base_url = endpoint, # config.get("OPENAI_API_BASE"),
|
575 |
temperature=0 # Controls randomness in responses; 0 ensures deterministic results
|
576 |
)
|
577 |
|
|
|
767 |
if 'chatbot' not in st.session_state:
|
768 |
st.session_state.chatbot = NutritionBot() # Blank #6: Fill in with the chatbot class initialization (e.g., NutritionBot)
|
769 |
|
770 |
+
response = st.session_state.chatbot.handle_customer_query(st.session_state.user_id, user_query)
|
771 |
# Blank #7: Fill in with the method to handle queries (e.g., handle_customer_query)
|
772 |
st.write(response)
|
773 |
st.session_state.chat_history.append({"role": "assistant", "content": response})
|