alanchen1115 commited on
Commit
4db0db1
1 Parent(s): fe2abeb

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
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.predict(event.message.text, api_name="/bot")
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)