Skip to content

Commit

Permalink
feat: update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Dec 20, 2023
1 parent aa57585 commit f656f89
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions examples/streaming_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,28 @@ def reply_text2(message):
# yield FeishuMessageCard(
# FeishuMessageDiv('reply1'),
# FeishuMessageHr(),
# FeishuMessageDiv(message.raw.event.message.content.text)
# FeishuMessageDiv(message.content.text)
# )
# yield FeishuMessageCard(
# FeishuMessageDiv('reply2'),
# FeishuMessageHr(),
# FeishuMessageDiv(message.raw.event.message.content.text)
# FeishuMessageDiv(message.content.text)
# )
# # finally result
# return FeishuMessageCard(
# FeishuMessageDiv('reply_result'),
# FeishuMessageHr(),
# FeishuMessageDiv(message.raw.event.message.content.text)
# FeishuMessageDiv(message.content.text)
# )
yield "reply_text1 " + message.raw.event.message.content.text
yield "reply_text2 " + message.raw.event.message.content.text
# finally result
return "reply_result " + message.raw.event.message.content.text
from time import sleep

if message.type == MessageType.Text:
yield "reply_text1 " + message.content.text
sleep(1)
yield "reply_text2 " + message.content.text
sleep(1)
return "reply_result " + message.content.text
return "only support text message"


with ca.MessageBroker() as broker:
Expand Down

0 comments on commit f656f89

Please sign in to comment.