Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,11 +9,8 @@ def send_command(description):
|
|
9 |
|
10 |
response = requests.post(endpoint, headers={"Authorization": f"Bearer {api_key}"}, json={"queries": [query]})
|
11 |
|
12 |
-
if response.status_code == 200:
|
13 |
result = response.json()
|
14 |
return result["choices"][0]["text"]
|
15 |
-
|
16 |
-
return "Произошла ошибка при отправке запроса."
|
17 |
-
|
18 |
iface = gr.Interface(fn=send_command, inputs="text", outputs="text", title="Minecraft Command Generator")
|
19 |
iface.launch()
|
|
|
9 |
|
10 |
response = requests.post(endpoint, headers={"Authorization": f"Bearer {api_key}"}, json={"queries": [query]})
|
11 |
|
|
|
12 |
result = response.json()
|
13 |
return result["choices"][0]["text"]
|
14 |
+
|
|
|
|
|
15 |
iface = gr.Interface(fn=send_command, inputs="text", outputs="text", title="Minecraft Command Generator")
|
16 |
iface.launch()
|