aiqtech commited on
Commit
ef4ed23
ยท
verified ยท
1 Parent(s): 6a8c09b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
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=gr.Textbox(label="์ด๋ฉ”์ผ ์ฃผ์†Œ", placeholder="์ด๋ฉ”์ผ์„ ์ž…๋ ฅํ•˜์„ธ์š”"),
 
 
 
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