Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,14 +13,13 @@ headers = {
|
|
| 13 |
"Authorization": f"Bearer {NEBIUS_API_KEY.strip()}",
|
| 14 |
"Content-Type": "application/json"
|
| 15 |
}
|
| 16 |
-
|
| 17 |
-
|
| 18 |
body = {
|
| 19 |
-
"
|
| 20 |
-
"
|
| 21 |
-
"
|
|
|
|
|
|
|
| 22 |
}
|
| 23 |
-
|
| 24 |
res = requests.post("https://llm.api.cloud.yandex.net/foundationModels/v1/completion", headers=headers, json=body)
|
| 25 |
if res.status_code == 200:
|
| 26 |
return res.json()['result']['alternatives'][0]['message']['text']
|
|
|
|
| 13 |
"Authorization": f"Bearer {NEBIUS_API_KEY.strip()}",
|
| 14 |
"Content-Type": "application/json"
|
| 15 |
}
|
|
|
|
|
|
|
| 16 |
body = {
|
| 17 |
+
"folderId": FOLDER_ID,
|
| 18 |
+
"texts": [input_text],
|
| 19 |
+
"model": "general",
|
| 20 |
+
"temperature": 0.6,
|
| 21 |
+
"maxTokens": "2000"
|
| 22 |
}
|
|
|
|
| 23 |
res = requests.post("https://llm.api.cloud.yandex.net/foundationModels/v1/completion", headers=headers, json=body)
|
| 24 |
if res.status_code == 200:
|
| 25 |
return res.json()['result']['alternatives'][0]['message']['text']
|