Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,27 @@
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
|
4 |
-
def send_webhook(email):
|
|
|
5 |
webhook_url = "https://connect.pabbly.com/workflow/sendwebhookdata/IjU3NjYwNTZmMDYzMDA0M2M1MjZiNTUzMzUxMzUi_pc"
|
6 |
-
payload = {"email": email}
|
7 |
|
8 |
try:
|
9 |
response = requests.post(webhook_url, json=payload)
|
10 |
-
return f"์๋ต ์ฝ๋: {response.status_code}\n์๋ต ๋ด์ฉ: {response.text}"
|
11 |
except Exception as e:
|
12 |
return f"์๋ฌ ๋ฐ์: {str(e)}"
|
13 |
|
14 |
# ์ธํฐํ์ด์ค ์์ฑ
|
15 |
demo = gr.Interface(
|
16 |
fn=send_webhook,
|
17 |
-
inputs=
|
|
|
|
|
|
|
18 |
outputs=gr.Textbox(label="๊ฒฐ๊ณผ"),
|
19 |
title="์ด๋ฉ์ผ ์นํ
์ ์ก",
|
20 |
-
description="
|
21 |
live=False
|
22 |
)
|
23 |
|
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
|
4 |
+
def send_webhook(email, input_text):
|
5 |
+
# ์ด๋ฉ์ผ ์ฃผ์๋ง ์นํ
์ผ๋ก ์ ์ก
|
6 |
webhook_url = "https://connect.pabbly.com/workflow/sendwebhookdata/IjU3NjYwNTZmMDYzMDA0M2M1MjZiNTUzMzUxMzUi_pc"
|
7 |
+
payload = {"email": email} # ์ด๋ฉ์ผ๋ง ํฌํจ
|
8 |
|
9 |
try:
|
10 |
response = requests.post(webhook_url, json=payload)
|
11 |
+
return f"์
๋ ฅํ ์ด๋ฉ์ผ: {email}\n์
๋ ฅํ ํ
์คํธ: {input_text}\n\n์ ์ก๋ ์ด๋ฉ์ผ ์ฃผ์์ ๋ํ ์นํ
์๋ต:\n์๋ต ์ฝ๋: {response.status_code}\n์๋ต ๋ด์ฉ: {response.text}"
|
12 |
except Exception as e:
|
13 |
return f"์๋ฌ ๋ฐ์: {str(e)}"
|
14 |
|
15 |
# ์ธํฐํ์ด์ค ์์ฑ
|
16 |
demo = gr.Interface(
|
17 |
fn=send_webhook,
|
18 |
+
inputs=[
|
19 |
+
gr.Textbox(label="์ด๋ฉ์ผ ์ฃผ์", placeholder="์ด๋ฉ์ผ์ ์
๋ ฅํ์ธ์"),
|
20 |
+
gr.Textbox(label="์
๋ ฅ๊ฐ", placeholder="ํ
์คํธ๋ฅผ ์
๋ ฅํ์ธ์")
|
21 |
+
],
|
22 |
outputs=gr.Textbox(label="๊ฒฐ๊ณผ"),
|
23 |
title="์ด๋ฉ์ผ ์นํ
์ ์ก",
|
24 |
+
description="์ด๋ฉ์ผ ์ฃผ์์ ํ
์คํธ๋ฅผ ์
๋ ฅ๋ฐ๊ณ , ์ด๋ฉ์ผ ์ฃผ์๋ง ์นํ
์ผ๋ก ์ ์กํฉ๋๋ค.",
|
25 |
live=False
|
26 |
)
|
27 |
|