Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import requests
|
3 |
+
|
4 |
+
def send_command(cmd):
|
5 |
+
url = "https://copilot.github1s.tk/"
|
6 |
+
payload = {
|
7 |
+
"prompt": f'Напиши пожалуйста команду для Minecraft JAVA 1.20, под описание: "{cmd}"',
|
8 |
+
"api_key": "dummy"
|
9 |
+
}
|
10 |
+
response = requests.post(url, json=payload)
|
11 |
+
if response.status_code == 200:
|
12 |
+
return response.json()
|
13 |
+
else:
|
14 |
+
return "Не удалось отправить запрос или получить ответ."
|
15 |
+
|
16 |
+
iface = gr.Interface(send_command, "text", "text", title="Minecraft Команды")
|
17 |
+
iface.launch()
|