Submit thread context in slack

This commit is contained in:
mudler
2023-12-16 19:10:31 +01:00
parent 7e3f2cbffb
commit f1b39164ef

View File

@@ -81,16 +81,16 @@ def respond_to_app_mention(
limit=1000, limit=1000,
).get("messages", []) ).get("messages", [])
reply = replies_in_thread[-1] reply = replies_in_thread[-1]
#for reply in replies_in_thread: for reply in replies_in_thread:
c = reply["text"]+"\n\n" c = reply["text"]+"\n\n"
content += c content += c
role = "assistant" if reply["user"] == context.bot_user_id else "user" role = "assistant" if reply["user"] == context.bot_user_id else "user"
messages.append( messages.append(
{ {
"role": role, "role": role,
"content": ( "content": (
format_openai_message_content( format_openai_message_content(
reply["text"], TRANSLATE_MARKDOWN content, TRANSLATE_MARKDOWN
) )
), ),
} }