opensearch-project/demos

[FEATURE][DocBot] discord should create a conversation for each channel in discord

オープン

#80 opened on 2023/11/01

 (2 件のコメント) (0 件のリアクション) (1 人の担当者) (18 件のフォーク)auto 404
OSCIenhancementgood first issuehelp wanted

Repository metrics

Stars
 (4 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Is your feature request related to a problem?

Right now when the discord bot is spun up it functionally does nothing. We need a conversations mechanism to track the conversations that are happening with our bot.

What solution would you like?

When the discord bot spins up it should do the following

  1. Check local state to see if there is a conversation for that channel already
  2. If none is found in state it should check OpenSearch for an existing conversation from that channel
  3. If there isn't already a conversation one should be created

After the conversation_id is found or created it should be tracked locally and used whenever new messages arrive on a channel.

Do you have any additional context?

class DocBot():
    def __init__ (self):
        self.conversations: {}

    def handle_message(message_object):
        # get conversation id form _conversation handler
        # with conversation id call docbot.generate response(conversation_id, message)
        # return response

    def _conversation_handler(self, conversation_name):
        # check if conversation in state
        # check if conversation exists. If it exists track conversation id in self.conversations by name: id
        # if conversation doesn't exists create and then track using the above method
        # return id

コントリビューターガイド