open_ai_bot 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab73dddf78a2ee4632cebce42aa05bfcbed8f2e124bf54c6db3c46ddded104f2
4
- data.tar.gz: aced420618f366b93f9255b1002ea4b94cdd20a376be69955afca99143ad37d9
3
+ metadata.gz: bb356e64b39be0d26d67b951fb369bfbe73f7ef75dbd1b7713ef34a69c609702
4
+ data.tar.gz: 6bd88aac60d93d779722799e96e583d876e34c352c07dca7ede1e0d5cd77dcbe
5
5
  SHA512:
6
- metadata.gz: 03f5fb788b3777e1b112a4d0af08765fad8d1ec35e274543576dea5c43e7ed354aecd0bd69e7ddc1855df3d015c3c1253519e2feec2cd1664073e3fe20966a04
7
- data.tar.gz: 693978a14106f13fd183451233d8cbda0d1158b152eba7f02c0f3c70558c830dae4e81eb4ad4235779c3525ec97ddf24ef41244d3b2fedb7c34822306219f0b4
6
+ metadata.gz: 1db16f7ad18c4b4f1418aefd245f40fd125bc3cc12e73b4bd90fbedafdbdc5280fc2ce4591049e0fdb1bd208b83301b2ff60bc25459c9f10181e465a31d3b2c3
7
+ data.tar.gz: '097d28aa7788ae0d33a41c8213de556ddf8a01f7ba07e965ae57093bcca134105cdb64546ffa34ab0d5ede6a59602c45a49ddbadb785eaab8371cb0dec552bcb'
@@ -104,7 +104,6 @@ module ChatGPT
104
104
  puts "#{Time.now.utc} | Chat ID: #{@chat.id}, tokens used: #{response.dig("usage", "total_tokens")}"
105
105
 
106
106
  send_chat_gpt_response(text)
107
- @thread.add!(:assistant, text)
108
107
  end
109
108
  end
110
109
  end
@@ -115,6 +114,7 @@ module ChatGPT
115
114
 
116
115
  def send_chat_gpt_response(text)
117
116
  reply(text)
117
+ @thread.add!(:assistant, text)
118
118
  end
119
119
 
120
120
  def add_name(name, text)
data/lib/open_ai/dalle.rb CHANGED
@@ -2,13 +2,7 @@
2
2
 
3
3
  module Dalle
4
4
  def dalle
5
- if !allowed_chat?
6
- if chat_not_allowed_message
7
- return reply(chat_not_allowed_message, parse_mode: "Markdown")
8
- else
9
- return
10
- end
11
- end
5
+ return unless allowed_chat?
12
6
 
13
7
  attempt(3) do
14
8
  puts "Received a /dalle command"
@@ -3,11 +3,11 @@
3
3
  module Whisper
4
4
  def transcribe
5
5
  if !allowed_chat?
6
- if chat_not_allowed_message
7
- return reply(chat_not_allowed_message, parse_mode: "Markdown")
8
- else
9
- return
6
+ if @command == "/transcribe"
7
+ reply(chat_not_allowed_message) if chat_not_allowed_message
10
8
  end
9
+
10
+ return
11
11
  end
12
12
 
13
13
  attempt(3) do
data/main.rb CHANGED
@@ -6,9 +6,9 @@ require "yaml"
6
6
  require "down"
7
7
  require "rubydium"
8
8
 
9
- require_relative "app/open_ai_bot"
10
- require_relative "app/clean_bot"
11
- require_relative "app/my_custom_bot"
9
+ require_relative "lib/open_ai_bot"
10
+ require_relative "lib/clean_bot"
11
+ require_relative "lib/my_custom_bot"
12
12
 
13
13
  bots = {
14
14
  "open_ai" => OpenAIBot,
data/open_ai_bot.gemspec CHANGED
@@ -5,7 +5,7 @@ require_relative "lib/open_ai_bot"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "open_ai_bot"
8
- spec.version = "0.2.0"
8
+ spec.version = "0.2.2"
9
9
  spec.authors = ["bulgakke"]
10
10
  spec.email = ["vvp835@yandex.ru"]
11
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_ai_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - bulgakke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-17 00:00:00.000000000 Z
11
+ date: 2023-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: down