File size: 1,203 Bytes
6a8c09b 6d854f4 ef4ed23 6a8c09b ef4ed23 6d854f4 6a8c09b ef4ed23 6a8c09b 6d854f4 6a8c09b ef4ed23 6a8c09b ef4ed23 6a8c09b 6d854f4 6a8c09b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import gradio as gr
import requests
def send_webhook(email, input_text):
# ์ด๋ฉ์ผ ์ฃผ์๋ง ์นํ
์ผ๋ก ์ ์ก
webhook_url = "https://connect.pabbly.com/workflow/sendwebhookdata/IjU3NjYwNTZmMDYzMDA0M2M1MjZiNTUzMzUxMzUi_pc"
payload = {"email": email} # ์ด๋ฉ์ผ๋ง ํฌํจ
try:
response = requests.post(webhook_url, json=payload)
return f"์
๋ ฅํ ์ด๋ฉ์ผ: {email}\n์
๋ ฅํ ํ
์คํธ: {input_text}\n\n์ ์ก๋ ์ด๋ฉ์ผ ์ฃผ์์ ๋ํ ์นํ
์๋ต:\n์๋ต ์ฝ๋: {response.status_code}\n์๋ต ๋ด์ฉ: {response.text}"
except Exception as e:
return f"์๋ฌ ๋ฐ์: {str(e)}"
# ์ธํฐํ์ด์ค ์์ฑ
demo = gr.Interface(
fn=send_webhook,
inputs=[
gr.Textbox(label="์ด๋ฉ์ผ ์ฃผ์", placeholder="์ด๋ฉ์ผ์ ์
๋ ฅํ์ธ์"),
gr.Textbox(label="์
๋ ฅ๊ฐ", placeholder="ํ
์คํธ๋ฅผ ์
๋ ฅํ์ธ์")
],
outputs=gr.Textbox(label="๊ฒฐ๊ณผ"),
title="์ด๋ฉ์ผ ์นํ
์ ์ก",
description="์ด๋ฉ์ผ ์ฃผ์์ ํ
์คํธ๋ฅผ ์
๋ ฅ๋ฐ๊ณ , ์ด๋ฉ์ผ ์ฃผ์๋ง ์นํ
์ผ๋ก ์ ์กํฉ๋๋ค.",
live=False
)
# ์ฑ ์คํ
if __name__ == "__main__":
demo.queue().launch(share=False, server_port=7860) |