Spaces:
Running
Running
Commit ยท
e686227
1
Parent(s): 4100485
no message
Browse files- app/app.py +7 -0
- requirements.txt +14 -2
app/app.py
CHANGED
|
@@ -62,6 +62,13 @@ async def handle_chatwork_webhook(
|
|
| 62 |
room_id = event.get("room_id")
|
| 63 |
from_account_id = event.get("account_id")
|
| 64 |
message_id = event.get("message_id")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
if room_id and from_account_id and message_id:
|
| 67 |
# Chatwork API ์๋ํฌ์ธํธ
|
|
|
|
| 62 |
room_id = event.get("room_id")
|
| 63 |
from_account_id = event.get("account_id")
|
| 64 |
message_id = event.get("message_id")
|
| 65 |
+
|
| 66 |
+
message_body = event.get("body")
|
| 67 |
+
if message_body:
|
| 68 |
+
# strip()์ ์ฌ์ฉํ์ฌ ์๋ค ๊ณต๋ฐฑ ๋ฐ ์ค๋ฐ๊ฟ ๋ฌธ์๋ฅผ ์ ๊ฑฐํ๊ณ ์ถ๋ ฅํฉ๋๋ค.
|
| 69 |
+
cleaned_message = message_body.strip()
|
| 70 |
+
print(f"Received message: {cleaned_message}")
|
| 71 |
+
print(f"Received body: {message_body}")
|
| 72 |
|
| 73 |
if room_id and from_account_id and message_id:
|
| 74 |
# Chatwork API ์๋ํฌ์ธํธ
|
requirements.txt
CHANGED
|
@@ -1,4 +1,16 @@
|
|
| 1 |
-
|
| 2 |
fastapi
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
python-dotenv
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
fastapi
|
| 3 |
+
uvicorn[standard]
|
| 4 |
+
|
| 5 |
+
requests
|
| 6 |
+
|
| 7 |
python-dotenv
|
| 8 |
+
|
| 9 |
+
google-api-python-client
|
| 10 |
+
google-auth-httplib2
|
| 11 |
+
google-auth-oauthlib
|
| 12 |
+
|
| 13 |
+
google-generativeai
|
| 14 |
+
google-cloud-aiplatform
|
| 15 |
+
|
| 16 |
+
pytz
|