Spaces:
Running
Running
Update app4.py
Browse files
app4.py
CHANGED
|
@@ -194,10 +194,9 @@ def update_news_hourly():
|
|
| 194 |
# Async Together API
|
| 195 |
# -------------------
|
| 196 |
async def async_together_chat(messages):
|
| 197 |
-
api_key = st.secrets["TOGETHER_API_KEY"] # Access here, not globally
|
| 198 |
url = "https://api.together.xyz/v1/chat/completions"
|
| 199 |
headers = {
|
| 200 |
-
"Authorization": f"Bearer {
|
| 201 |
"Content-Type": "application/json",
|
| 202 |
}
|
| 203 |
payload = {
|
|
|
|
| 194 |
# Async Together API
|
| 195 |
# -------------------
|
| 196 |
async def async_together_chat(messages):
|
|
|
|
| 197 |
url = "https://api.together.xyz/v1/chat/completions"
|
| 198 |
headers = {
|
| 199 |
+
"Authorization": f"Bearer {os.environ['TOGETHER_API_KEY']}",
|
| 200 |
"Content-Type": "application/json",
|
| 201 |
}
|
| 202 |
payload = {
|