Skip to content

Commit

Permalink
fix files_upload thread_ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nalbam committed Jun 5, 2024
1 parent 9072fda commit f75862e
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,27 +299,11 @@ def conversation(say: Say, thread_ts, content, channel, user, client_msg_id):
# Send the prompt to Bedrock
message = invoke_claude_3(content)

else:
chat_update(channel, latest_ts, "응답 기다리는 중... " + BOT_CURSOR)

prompt = "\n\n\n".join(prompts)

content[0]["text"] = prompt

# Send the prompt to Bedrock
message = invoke_claude_3(content)

message = message.replace("**", "*")

# Update the message in Slack
chat_update(channel, latest_ts, message)

# Generate an image
if type == "image" and len(content) > 1:
chat_update(channel, latest_ts, "이미지 그리는 중... " + BOT_CURSOR)

image = invoke_stable_diffusion(message)

# Update the message in Slack
chat_update(channel, latest_ts, message)

if image:
Expand All @@ -330,8 +314,24 @@ def conversation(say: Say, thread_ts, content, channel, user, client_msg_id):
title="Generated Image",
filename="image.jpg",
initial_comment="Here is the generated image.",
thread_ts=latest_ts,
)

else:
chat_update(channel, latest_ts, "응답 기다리는 중... " + BOT_CURSOR)

prompt = "\n\n\n".join(prompts)

content[0]["text"] = prompt

# Send the prompt to Bedrock
message = invoke_claude_3(content)

message = message.replace("**", "*")

# Update the message in Slack
chat_update(channel, latest_ts, message)


# Get image from URL
def get_image_from_url(image_url, token=None):
Expand Down

0 comments on commit f75862e

Please sign in to comment.