Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -55,8 +55,8 @@ from datetime import datetime
|
|
| 55 |
|
| 56 |
#====================================SETUP=====================================#
|
| 57 |
# Fetch secrets from Hugging Face Spaces
|
| 58 |
-
api_key =
|
| 59 |
-
endpoint =
|
| 60 |
llama_api_key = os.environ['GROQ_API_KEY']
|
| 61 |
MEM0_api_key = os.environ['mem0']
|
| 62 |
|
|
@@ -519,8 +519,8 @@ class NutritionBot:
|
|
| 519 |
# Initialize the OpenAI client using the provided credentials
|
| 520 |
self.client = ChatOpenAI(
|
| 521 |
model_name="gpt-4o-mini", # Specify the model to use (e.g., GPT-4 optimized version)
|
| 522 |
-
api_key=
|
| 523 |
-
base_url =
|
| 524 |
temperature=0 # Controls randomness in responses; 0 ensures deterministic results
|
| 525 |
)
|
| 526 |
|
|
|
|
| 55 |
|
| 56 |
#====================================SETUP=====================================#
|
| 57 |
# Fetch secrets from Hugging Face Spaces
|
| 58 |
+
api_key = os.environ["API_KEY"]
|
| 59 |
+
endpoint = os.environ["OPENAI_API_BASE"]
|
| 60 |
llama_api_key = os.environ['GROQ_API_KEY']
|
| 61 |
MEM0_api_key = os.environ['mem0']
|
| 62 |
|
|
|
|
| 519 |
# Initialize the OpenAI client using the provided credentials
|
| 520 |
self.client = ChatOpenAI(
|
| 521 |
model_name="gpt-4o-mini", # Specify the model to use (e.g., GPT-4 optimized version)
|
| 522 |
+
api_key=os.environ["OPENAI_API_BASE"], # API key for authentication
|
| 523 |
+
base_url = os.environ["OPENAI_API_BASE"],
|
| 524 |
temperature=0 # Controls randomness in responses; 0 ensures deterministic results
|
| 525 |
)
|
| 526 |
|