chatgpt_assistant 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +14 -11
- data/lib/bots/discord_bot.rb +11 -11
- data/lib/bots/telegram_bot.rb +1 -1
- data/lib/chatgpt_assistant/default_messages.rb +2 -0
- data/lib/chatgpt_assistant/models.rb +1 -1
- data/lib/chatgpt_assistant/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 8c2a41c81a5e742715d9b0710ff7c5866ba40d718931c3a6f0caa470613b23cd
         | 
| 4 | 
            +
              data.tar.gz: 73d6d84ccabd93c017b776083689f799f78e7b81355f02ca33a552fba601cf89
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: e55c21e292cc6bb2ee86bf86dca5ed881a02e834e30b5bf982f028dd0e34cf23c6c1978274873a04c50a845f157034cc1132050104d13899dce97d3c62e808cd
         | 
| 7 | 
            +
              data.tar.gz: ca83c1370beed7b168375ed3f8ecfd168950d0fde50c72a12784e2c28a58660c5838de0c969528bd8a47ddca11b1bc6a121c825f370a20165a09dda5fec0d59e
         | 
    
        data/README.md
    CHANGED
    
    | @@ -86,17 +86,20 @@ After starting the Docker Compose services, you can use the features of the gem | |
| 86 86 |  | 
| 87 87 | 
             
            ## Discord Bot Commands
         | 
| 88 88 |  | 
| 89 | 
            -
             | 
| 90 | 
            -
             | 
| 91 | 
            -
             | 
| 92 | 
            -
            - ! | 
| 93 | 
            -
            - ! | 
| 94 | 
            -
            - ! | 
| 95 | 
            -
            - ! | 
| 96 | 
            -
            - ! | 
| 97 | 
            -
            - ! | 
| 98 | 
            -
            - ! | 
| 99 | 
            -
            - ! | 
| 89 | 
            +
            The discord commands prefix can be changed in the .env file.
         | 
| 90 | 
            +
            The default prefix is dgpt!
         | 
| 91 | 
            +
             | 
| 92 | 
            +
            - dgpt!start - shows the welcome message
         | 
| 93 | 
            +
            - dgpt!help - shows the help message
         | 
| 94 | 
            +
            - dgpt!login email:password - logs in the user
         | 
| 95 | 
            +
            - dgpt!register email:password - registers a new user
         | 
| 96 | 
            +
            - dgpt!list - lists the user created chatbots
         | 
| 97 | 
            +
            - dgpt!sl_chat CHAT TITLE - starts a chat with the chatbot with the given title
         | 
| 98 | 
            +
            - dgpt!new_chat CHAT TITLE - creates a new chatbot with the given title
         | 
| 99 | 
            +
            - dgpt!ask TEXT - sends a text to the chatbot
         | 
| 100 | 
            +
            - dgpt!connect - connects the chat bot to the current channel
         | 
| 101 | 
            +
            - dgpt!disconnect - disconnects the chat bot from the current channel
         | 
| 102 | 
            +
            - dgpt!speak TEXT - sends a text to the chatbot and gets the response in voice
         | 
| 100 103 |  | 
| 101 104 | 
             
            ## Telegram Bot Commands
         | 
| 102 105 |  | 
    
        data/lib/bots/discord_bot.rb
    CHANGED
    
    | @@ -97,7 +97,7 @@ module ChatgptAssistant | |
| 97 97 | 
             
                end
         | 
| 98 98 |  | 
| 99 99 | 
             
                def list_action
         | 
| 100 | 
            -
                  chats_title = chats.map(&:title)
         | 
| 100 | 
            +
                  chats_title = user.chats.map(&:title)
         | 
| 101 101 | 
             
                  evnt.respond commom_messages[:chat_list]
         | 
| 102 102 | 
             
                  evnt.respond chats_title.join("\n")
         | 
| 103 103 | 
             
                end
         | 
| @@ -148,8 +148,8 @@ module ChatgptAssistant | |
| 148 148 | 
             
                end
         | 
| 149 149 |  | 
| 150 150 | 
             
                def create_chat_action
         | 
| 151 | 
            -
                  chat_title =  | 
| 152 | 
            -
                  chat = Chat.new(user_id: user.id, title: chat_title, status: 0)
         | 
| 151 | 
            +
                  chat_title = evnt.message.content.split(" ")[1..].join(" ")
         | 
| 152 | 
            +
                  @chat = Chat.new(user_id: user.id, title: chat_title, status: 0)
         | 
| 153 153 | 
             
                  chat.save ? respond_with_success : evnt.respond(error_messages[:chat_creation])
         | 
| 154 154 | 
             
                end
         | 
| 155 155 |  | 
| @@ -216,8 +216,8 @@ module ChatgptAssistant | |
| 216 216 | 
             
                end
         | 
| 217 217 |  | 
| 218 218 | 
             
                def voice_connection_checker_action
         | 
| 219 | 
            -
                  evnt.respond error_messages[:user_not_in_voice_channel] if  | 
| 220 | 
            -
                  evnt.respond error_messages[:bot_already_connected] if  | 
| 219 | 
            +
                  evnt.respond error_messages[:user_not_in_voice_channel] if evnt.user.voice_channel.nil? && user
         | 
| 220 | 
            +
                  evnt.respond error_messages[:bot_already_connected] if evnt.voice && user
         | 
| 221 221 | 
             
                end
         | 
| 222 222 |  | 
| 223 223 | 
             
                def bot_disconnected?
         | 
| @@ -239,12 +239,12 @@ module ChatgptAssistant | |
| 239 239 |  | 
| 240 240 | 
             
                def disconnect_checker_action
         | 
| 241 241 | 
             
                  evnt.respond error_messages[:user_not_logged_in] if user.nil?
         | 
| 242 | 
            -
                  evnt.respond error_messages[:user_not_in_voice_channel] if  | 
| 243 | 
            -
                  evnt.respond error_messages[:user_not_connected] if ! | 
| 242 | 
            +
                  evnt.respond error_messages[:user_not_in_voice_channel] if evnt.user.voice_channel.nil? && user
         | 
| 243 | 
            +
                  evnt.respond error_messages[:user_not_connected] if !evnt.voice && user
         | 
| 244 244 | 
             
                end
         | 
| 245 245 |  | 
| 246 246 | 
             
                def disconnect_action
         | 
| 247 | 
            -
                  bot.voice_destroy( | 
| 247 | 
            +
                  bot.voice_destroy(evnt.user.voice_channel)
         | 
| 248 248 | 
             
                  "Disconnected from voice channel"
         | 
| 249 249 | 
             
                end
         | 
| 250 250 |  | 
| @@ -262,12 +262,12 @@ module ChatgptAssistant | |
| 262 262 |  | 
| 263 263 | 
             
                def speak_connect_checker_action
         | 
| 264 264 | 
             
                  evnt.respond error_messages[:user_not_logged_in] if user.nil?
         | 
| 265 | 
            -
                  evnt.respond error_messages[:chat_not_found] if user &&  | 
| 265 | 
            +
                  evnt.respond error_messages[:chat_not_found] if user && evnt.user.voice_channel && evnt.voice && chat.nil?
         | 
| 266 266 | 
             
                end
         | 
| 267 267 |  | 
| 268 268 | 
             
                def speak_connection_checker_action
         | 
| 269 | 
            -
                  evnt.respond error_messages[:user_not_in_voice_channel] if  | 
| 270 | 
            -
                  evnt.respond error_messages[:bot_not_in_voice_channel] if ! | 
| 269 | 
            +
                  evnt.respond error_messages[:user_not_in_voice_channel] if evnt.user.voice_channel.nil? && user
         | 
| 270 | 
            +
                  evnt.respond error_messages[:bot_not_in_voice_channel] if !evnt.voice && user
         | 
| 271 271 | 
             
                end
         | 
| 272 272 |  | 
| 273 273 | 
             
                def ask_to_speak_action
         | 
    
        data/lib/bots/telegram_bot.rb
    CHANGED
    
    
| @@ -51,6 +51,7 @@ module ChatgptAssistant | |
| 51 51 | 
             
                    nil: "Não entendi o que você disse. Tente novamente",
         | 
| 52 52 | 
             
                    email: "O email que você digitou não é válido. Tente novamente",
         | 
| 53 53 | 
             
                    password: "A senha que você digitou não é válida. Tente novamente",
         | 
| 54 | 
            +
                    wrong_password: "A senha que você digitou não é válida. Tente novamente",
         | 
| 54 55 | 
             
                    user: "O usuário que você digitou não existe. Tente novamente",
         | 
| 55 56 | 
             
                    user_creation: "Erro ao criar usuário. Tente novamente",
         | 
| 56 57 | 
             
                    user_already_exists: "O usuário que você digitou já existe. Tente novamente",
         | 
| @@ -113,6 +114,7 @@ module ChatgptAssistant | |
| 113 114 | 
             
                    nil: "I didn't understand what you said. Try again",
         | 
| 114 115 | 
             
                    email: "The email you typed is not valid. Try again",
         | 
| 115 116 | 
             
                    password: "The password you typed is not valid. Try again",
         | 
| 117 | 
            +
                    wrong_password: "The password you typed is not valid. Try again",
         | 
| 116 118 | 
             
                    user: "The user you typed does not exist. Try again",
         | 
| 117 119 | 
             
                    user_creation: "Error creating user. Try again",
         | 
| 118 120 | 
             
                    chat_creation: "Error creating chat. Try again",
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: chatgpt_assistant
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - JesusGautamah
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2023-04- | 
| 11 | 
            +
            date: 2023-04-04 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies: []
         | 
| 13 13 | 
             
            description: |-
         | 
| 14 14 | 
             
              This gem has the intention to facilitate the creation of chatbots with GPT-3.5-turbo,
         |