Spaces:
Sleeping
Sleeping
alanchen1115
commited on
Commit
β’
4db0db1
1
Parent(s):
fe2abeb
Update main.py
Browse files
main.py
CHANGED
@@ -14,6 +14,7 @@ from linebot.exceptions import (
|
|
14 |
from linebot.models import (
|
15 |
MessageEvent, TextMessage, TextSendMessage, ImageSendMessage, AudioMessage
|
16 |
)
|
|
|
17 |
client = Client("alanchen1115/Gemini")
|
18 |
app = FastAPI()
|
19 |
app.add_middleware(
|
@@ -60,12 +61,12 @@ def handle_message(event):
|
|
60 |
return
|
61 |
|
62 |
if working_status:
|
63 |
-
out = client.
|
64 |
if not out:
|
65 |
out = "δΈζζ¨ηζζ!"
|
66 |
line_bot_api.reply_message(
|
67 |
event.reply_token,
|
68 |
-
TextSendMessage(text=out)
|
69 |
|
70 |
if __name__ == "__main__":
|
71 |
uvicorn.run("main:app", host="0.0.0.0", port=7860, reload=True)
|
|
|
14 |
from linebot.models import (
|
15 |
MessageEvent, TextMessage, TextSendMessage, ImageSendMessage, AudioMessage
|
16 |
)
|
17 |
+
|
18 |
client = Client("alanchen1115/Gemini")
|
19 |
app = FastAPI()
|
20 |
app.add_middleware(
|
|
|
61 |
return
|
62 |
|
63 |
if working_status:
|
64 |
+
out = client.submit(event.message.text, api_name="/bot").result()
|
65 |
if not out:
|
66 |
out = "δΈζζ¨ηζζ!"
|
67 |
line_bot_api.reply_message(
|
68 |
event.reply_token,
|
69 |
+
TextSendMessage(text=out)
|
70 |
|
71 |
if __name__ == "__main__":
|
72 |
uvicorn.run("main:app", host="0.0.0.0", port=7860, reload=True)
|