Skip to content

Commit

Permalink
fix: prompt engine handle preset correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
lss233 committed Sep 10, 2023
1 parent 1b5df48 commit 5bc4fb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion framework/platforms/qq_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def post_response_function(client, message: Message, text=None, image=None
send_payload['channel_id'] = message.channel_id

if text:
send_payload['content'] = text
send_payload['content'] = text.replace('.', ' . ')
if image:
send_payload['file_image'] = await image.get_bytes()
await send_func(**send_payload)
Expand Down
5 changes: 4 additions & 1 deletion framework/prompt_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ async def execute_action_block(action_flow: List[ActionBlockBaseModel], context:
for i in range(block.retry + 1):
try:
result = action_callable(**args)
if result and inspect.iscoroutine(result):
if result and inspect.isasyncgen(result):
async for result in result:
pass
elif result and inspect.iscoroutine(result):
result = await result

if block.name:
Expand Down

0 comments on commit 5bc4fb6

Please sign in to comment.