chatgpt_assistant 0.1.6 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.env_sample +35 -10
  3. data/.rubocop.yml +14 -3
  4. data/Dockerfile +11 -5
  5. data/Gemfile +25 -23
  6. data/Gemfile.lock +123 -85
  7. data/README.md +22 -22
  8. data/Rakefile +1 -0
  9. data/docker-compose.yml +8 -4
  10. data/exe/chatgpt_assistant +1 -1
  11. data/lib/chatgpt_assistant/audio_synthesis.rb +54 -15
  12. data/lib/{bots → chatgpt_assistant/bots}/application_bot.rb +0 -6
  13. data/lib/chatgpt_assistant/bots/discord/actions.rb +103 -0
  14. data/lib/chatgpt_assistant/bots/discord/auth.rb +36 -0
  15. data/lib/chatgpt_assistant/bots/discord/bot.rb +29 -0
  16. data/lib/chatgpt_assistant/bots/discord/chat_actions.rb +33 -0
  17. data/lib/chatgpt_assistant/bots/discord/events.rb +138 -0
  18. data/lib/chatgpt_assistant/bots/discord/validations.rb +38 -0
  19. data/lib/chatgpt_assistant/bots/discord/voice_actions.rb +33 -0
  20. data/lib/chatgpt_assistant/bots/discord/voice_checkers.rb +35 -0
  21. data/lib/chatgpt_assistant/bots/discord_bot.rb +41 -0
  22. data/lib/chatgpt_assistant/bots/helpers/messenger_helper.rb +16 -0
  23. data/lib/{bots → chatgpt_assistant/bots}/jobs/register_job.rb +2 -2
  24. data/lib/chatgpt_assistant/bots/mailers/account_mailer.rb +30 -0
  25. data/lib/chatgpt_assistant/bots/mailers/application_mailer.rb +21 -0
  26. data/lib/chatgpt_assistant/bots/services/new_chat_service.rb +59 -0
  27. data/lib/chatgpt_assistant/bots/services/register_service.rb +45 -0
  28. data/lib/chatgpt_assistant/bots/telegram/actions.rb +54 -0
  29. data/lib/chatgpt_assistant/bots/telegram/auth.rb +40 -0
  30. data/lib/chatgpt_assistant/bots/telegram/bot.rb +17 -0
  31. data/lib/chatgpt_assistant/bots/telegram/chat_actions.rb +30 -0
  32. data/lib/chatgpt_assistant/bots/telegram/events.rb +121 -0
  33. data/lib/chatgpt_assistant/bots/telegram/events_controller.rb +48 -0
  34. data/lib/chatgpt_assistant/bots/telegram/permissions.rb +48 -0
  35. data/lib/chatgpt_assistant/bots/telegram/validations.rb +55 -0
  36. data/lib/chatgpt_assistant/bots/telegram/voice_actions.rb +36 -0
  37. data/lib/chatgpt_assistant/bots/telegram_bot.rb +44 -0
  38. data/lib/chatgpt_assistant/chatter.rb +10 -2
  39. data/lib/chatgpt_assistant/config.rb +7 -1
  40. data/lib/chatgpt_assistant/default_messages.rb +10 -4
  41. data/lib/chatgpt_assistant/error.rb +9 -0
  42. data/lib/chatgpt_assistant/migrations.rb +5 -0
  43. data/lib/chatgpt_assistant/models.rb +20 -0
  44. data/lib/chatgpt_assistant/version.rb +1 -1
  45. data/lib/chatgpt_assistant.rb +5 -3
  46. metadata +35 -25
  47. data/.env_prod_sample +0 -18
  48. data/docker-compose.prod.yml +0 -34
  49. data/lib/bots/discord_bot.rb +0 -182
  50. data/lib/bots/helpers/authentication_helper.rb +0 -48
  51. data/lib/bots/helpers/discord_helper.rb +0 -124
  52. data/lib/bots/helpers/discord_voice_helper.rb +0 -50
  53. data/lib/bots/helpers/messenger_helper.rb +0 -133
  54. data/lib/bots/helpers/telegram_helper.rb +0 -73
  55. data/lib/bots/helpers/telegram_voice_helper.rb +0 -33
  56. data/lib/bots/helpers/validation_helper.rb +0 -38
  57. data/lib/bots/helpers/visit_helper.rb +0 -28
  58. data/lib/bots/services/new_chat_service.rb +0 -34
  59. data/lib/bots/services/register_service.rb +0 -36
  60. data/lib/bots/telegram_bot.rb +0 -180
  61. /data/lib/{bots → chatgpt_assistant/bots}/helpers/audio_helper.rb +0 -0
  62. /data/lib/{bots → chatgpt_assistant/bots}/helpers/file_helper.rb +0 -0
  63. /data/lib/{bots → chatgpt_assistant/bots}/helpers/search_helper.rb +0 -0
  64. /data/lib/{bots → chatgpt_assistant/bots}/jobs/new_chat_job.rb +0 -0
  65. /data/lib/{bots → chatgpt_assistant/bots}/jobs/voice_connect_job.rb +0 -0
  66. /data/lib/{bots → chatgpt_assistant/bots}/services/voice_connect_service.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9317ab1f4742c358a91f3e8ec363d8ed72147c2a31e0a312ec6c5ad54215c8db
4
- data.tar.gz: e3a6a3f6099a4dcb47b262fb388f5f783a2f48466b1946f2e140e1a1b4c25767
3
+ metadata.gz: cb819ab0257d4970e716aed3d6d59cb5ef89d0476525b5c7dbd93f03df97b309
4
+ data.tar.gz: 9ce437ae8051fab6fbfd0b446fdaecd60f17dad068d55d96d572877c915b217f
5
5
  SHA512:
6
- metadata.gz: 3ea5f6b13b7db43f7261d9a726257bdf9e37a45bda2d34149bf7c35c659eee8092aec29a3dc7db8dc3222c005c65941f10f6b24f589f20ab0786a91e69290f27
7
- data.tar.gz: 46e7e83be3e53a7ece0fbaf0c59d67054270e05e0d6fad8b4fb09194f57a2de82d136203110fb9de20d11a1160c8b29dd2be19a026567528c898224a08452f67
6
+ metadata.gz: aac472695d96b1566294928d09a80b4d49f995519da1df049f85aa8a51baff1585e35f8669f2842755423303f4a1b27eb740a7ca9c00691978e47254edbd5494
7
+ data.tar.gz: fd8075eb05fe5e354676311884ba55f26ae5a073536076a4d40914e34a66c4e45e7f98e9d85967d9a36828362f4cf9076d2e74af2c99359fddbf39fd907218db
data/.env_sample CHANGED
@@ -1,18 +1,43 @@
1
+ # Bot Settings
1
2
  ENV_TYPE=development
2
- LANGUAGE=en # or pt currently
3
- MODE=aws # or ibm
3
+ LANGUAGE=en
4
+ MODE=aws
4
5
  DISCORD_PREFIX=!!
6
+ LUCY_SU= Your command to run docker compose as root
5
7
 
6
- POSTGRES_DB=chatgpt_assistant_development # or your database
7
- POSTGRES_USER=postgres # or your user
8
- POSTGRES_PASSWORD=postgres # or your password
8
+ # Database Settings
9
+ POSTGRES_DB=chatgpt_assistant_development
10
+ POSTGRES_USER=postgres
11
+ POSTGRES_PASSWORD=postgres
9
12
 
10
- IBM_API_KEY=Your IBM API Key
11
- IBM_URL=Your IBM Text to Speech URL
13
+ # Server Settings
14
+ REDIS_URL=redis://localhost:6379
15
+
16
+ # Bot Settings
12
17
  TELEGRAM_TOKEN=Your Telegram Bot Token
18
+ DISCORD_CLIENT_ID=Your Discord Client ID
19
+ DISCORD_TOKEN=Your Discord Token
20
+
21
+ # OpenAI Settings
13
22
  OPENAI_API_KEY=Your OpenAI API Key
14
- AWS_ACCESS_KEY=Your AWS Access Key
23
+
24
+ # API Settings - Set MODE to the API you want to use for text to speech
25
+ IBM_API_KEY=Your IBM API Key # set MODE=ibm
26
+ IBM_URL=Your IBM Text to Speech URL
27
+
28
+ AWS_ACCESS_KEY=Your AWS Access Key ID # set MODE=aws
15
29
  AWS_SECRET_ACCESS_KEY=Your AWS Secret Access Key
16
30
  AWS_REGION=Your AWS Region
17
- DISCORD_CLIENT_ID=Your Discord Client ID
18
- DISCORD_TOKEN=Your Discord Token
31
+
32
+ AZURE_SPEECH_URL= YOUR_AZURE_SPEECH_URL # set MODE=azure
33
+ AZURE_SPEECH_KEY= YOUR_AZURE_SPEECH_KEY
34
+
35
+ # SMTP Settings
36
+ SMTP_ADDRESS=YOUR_SMTP_ADDRESS
37
+ SMTP_PASSWORD=YOUR_SMTP_PASSWORD
38
+ SMTP_PORT=YOUR_SMTP_PORT
39
+ SMTP_USER_NAME=YOUR_SMTP_USER_NAME
40
+ SMTP_DOMAIN=YOUR_SMTP_DOMAIN
41
+ SMTP_AUTHENTICATION=plain
42
+ SMTP_ENABLE_STARTTLS_AUTO=true
43
+
data/.rubocop.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.6
3
3
  NewCops: enable
4
+ Exclude:
5
+ - 'Gemfile.lock'
4
6
 
5
7
  Style/StringLiterals:
6
8
  Enabled: true
@@ -26,13 +28,22 @@ Metrics/ClassLength:
26
28
  Max: 300
27
29
 
28
30
  Metrics/AbcSize:
29
- Max: 35
31
+ Max: 62
32
+
33
+ Metrics/PerceivedComplexity:
34
+ Max: 15
35
+
36
+ Metrics/CyclomaticComplexity:
37
+ Max: 15
38
+
39
+ Style/Documentation:
40
+ Enabled: false
30
41
 
31
42
  Layout/AccessModifierIndentation:
32
43
  EnforcedStyle: indent
33
-
44
+
34
45
  Layout/IndentationWidth:
35
46
  Width: 2
36
47
 
37
48
  Layout/IndentationConsistency:
38
- EnforcedStyle: indented_internal_methods
49
+ EnforcedStyle: indented_internal_methods
data/Dockerfile CHANGED
@@ -1,12 +1,18 @@
1
1
  FROM ruby:3.2.2
2
2
  RUN apt-get update -qq && apt-get install -y nodejs postgresql-client ffmpeg
3
- WORKDIR /chatgpt_assistant
4
- COPY Gemfile /chatgpt_assistant/Gemfile
5
- COPY Gemfile.lock /chatgpt_assistant/Gemfile.lock
3
+ WORKDIR /assistant
4
+ COPY Gemfile /assistant/Gemfile
5
+ COPY Gemfile.lock /assistant/Gemfile.lock
6
6
  RUN bundle install
7
7
 
8
- RUN apt-get install -y wget
8
+ RUN apt-get install -y wget libopus0 opus-tools
9
9
  RUN wget https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz
10
10
  RUN tar -xvf opus-1.3.1.tar.gz
11
11
  RUN cd opus-1.3.1 && ./configure && make && make install
12
- RUN rm -rf opus-1.3.1.tar.gz opus-1.3.1
12
+ RUN rm -rf opus-1.3.1.tar.gz opus-1.3.1
13
+
14
+ RUN wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
15
+ RUN tar -xvf libsodium-1.0.18.tar.gz
16
+ RUN cd libsodium-1.0.18 && ./configure && make && make install
17
+ RUN ldconfig
18
+ RUN rm -rf libsodium-1.0.18.tar.gz libsodium-1.0.18
data/Gemfile CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "bcrypt"
5
+ gem "bcrypt", "~> 3.1"
6
6
 
7
7
  gem "rake", "~> 13.0"
8
8
 
@@ -10,54 +10,56 @@ gem "rspec", "~> 3.12", group: :test
10
10
 
11
11
  gem "rspec-rails", "~> 6.0", group: :test
12
12
 
13
- gem "simplecov", "~> 0.21", group: :test
13
+ gem "simplecov", "~> 0.22", group: :test
14
14
 
15
- gem "vcr", "~> 6.0", group: :test
15
+ gem "vcr", "~> 6.1", group: :test
16
16
 
17
17
  gem "shoulda-matchers", "~> 5.3", group: :test
18
18
 
19
- gem "factory_bot_rails", "~> 6.0", group: :test
19
+ gem "factory_bot_rails", "~> 6.2", group: :test
20
20
 
21
- gem "faker", "~> 2.0", group: :test
21
+ gem "faker", "~> 2.23", group: :test
22
22
 
23
23
  gem "database_cleaner", "~> 2.0", group: :test
24
24
 
25
- gem "dotenv", "~> 2.0", group: :test
25
+ gem "dotenv", "~> 2.8", group: :test
26
26
 
27
27
  gem "rubocop", "~> 1.50"
28
28
 
29
- gem "rubocop-rspec", "~> 2.20"
29
+ gem "rubocop-rspec", "~> 2.22"
30
30
 
31
- gem "telegram-bot-ruby", "~> 0.16"
31
+ gem "telegram-bot-ruby", "~> 1.0"
32
32
 
33
33
  gem "discordrb", "~> 3.4"
34
34
 
35
- gem "faraday"
35
+ gem "faraday", "~> 2.7"
36
36
 
37
- gem "activemodel"
37
+ gem "activemodel", "~> 6.1"
38
38
 
39
- gem "activerecord"
39
+ gem "activerecord", "~> 6.1"
40
40
 
41
- gem "activesupport"
41
+ gem "activesupport", "~> 6.1"
42
42
 
43
- gem "redis"
43
+ gem "actionmailer", "~> 6.1"
44
44
 
45
- gem "sidekiq"
45
+ gem "redis", "~> 5.0"
46
46
 
47
- gem "sidekiq-scheduler"
47
+ gem "sidekiq", "~> 7.0"
48
48
 
49
- gem "activerecord-import"
49
+ gem "sidekiq-scheduler", "~> 5.0"
50
50
 
51
- gem "pg"
51
+ gem "activerecord-import", "~> 1.4"
52
52
 
53
- gem "streamio-ffmpeg"
53
+ gem "pg", "~> 1.5"
54
54
 
55
- gem "lucy_dockerunner"
55
+ gem "streamio-ffmpeg", "~> 3.0"
56
56
 
57
- gem "ibm_watson"
57
+ gem "lucy_dockerunner", "~> 0.2"
58
58
 
59
- gem "aws-sdk-polly"
59
+ gem "ibm_watson", "~> 2.2"
60
60
 
61
- gem "awesome_chatgpt_actors"
61
+ gem "aws-sdk-polly", "~> 1.72"
62
62
 
63
- gem "sidekiq-expiring-jobs"
63
+ gem "awesome_chatgpt_actors", "~> 0.1"
64
+
65
+ gem "sidekiq-expiring-jobs", "~> 0.1"
data/Gemfile.lock CHANGED
@@ -1,56 +1,61 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- actionpack (7.0.4.3)
5
- actionview (= 7.0.4.3)
6
- activesupport (= 7.0.4.3)
7
- rack (~> 2.0, >= 2.2.0)
4
+ actionmailer (6.1.7.3)
5
+ actionpack (= 6.1.7.3)
6
+ actionview (= 6.1.7.3)
7
+ activejob (= 6.1.7.3)
8
+ activesupport (= 6.1.7.3)
9
+ mail (~> 2.5, >= 2.5.4)
10
+ rails-dom-testing (~> 2.0)
11
+ actionpack (6.1.7.3)
12
+ actionview (= 6.1.7.3)
13
+ activesupport (= 6.1.7.3)
14
+ rack (~> 2.0, >= 2.0.9)
8
15
  rack-test (>= 0.6.3)
9
16
  rails-dom-testing (~> 2.0)
10
17
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
11
- actionview (7.0.4.3)
12
- activesupport (= 7.0.4.3)
18
+ actionview (6.1.7.3)
19
+ activesupport (= 6.1.7.3)
13
20
  builder (~> 3.1)
14
21
  erubi (~> 1.4)
15
22
  rails-dom-testing (~> 2.0)
16
23
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
17
- activemodel (7.0.4.3)
18
- activesupport (= 7.0.4.3)
19
- activerecord (7.0.4.3)
20
- activemodel (= 7.0.4.3)
21
- activesupport (= 7.0.4.3)
24
+ activejob (6.1.7.3)
25
+ activesupport (= 6.1.7.3)
26
+ globalid (>= 0.3.6)
27
+ activemodel (6.1.7.3)
28
+ activesupport (= 6.1.7.3)
29
+ activerecord (6.1.7.3)
30
+ activemodel (= 6.1.7.3)
31
+ activesupport (= 6.1.7.3)
22
32
  activerecord-import (1.4.1)
23
33
  activerecord (>= 4.2)
24
- activesupport (7.0.4.3)
34
+ activesupport (6.1.7.3)
25
35
  concurrent-ruby (~> 1.0, >= 1.0.2)
26
36
  i18n (>= 1.6, < 2)
27
37
  minitest (>= 5.1)
28
38
  tzinfo (~> 2.0)
39
+ zeitwerk (~> 2.3)
29
40
  addressable (2.8.4)
30
41
  public_suffix (>= 2.0.2, < 6.0)
31
42
  ast (2.4.2)
32
43
  awesome_chatgpt_actors (0.1.3)
33
44
  csv (~> 3.1)
34
45
  aws-eventstream (1.2.0)
35
- aws-partitions (1.748.0)
36
- aws-sdk-core (3.171.0)
46
+ aws-partitions (1.785.0)
47
+ aws-sdk-core (3.178.0)
37
48
  aws-eventstream (~> 1, >= 1.0.2)
38
49
  aws-partitions (~> 1, >= 1.651.0)
39
50
  aws-sigv4 (~> 1.5)
40
51
  jmespath (~> 1, >= 1.6.1)
41
- aws-sdk-polly (1.66.0)
42
- aws-sdk-core (~> 3, >= 3.165.0)
52
+ aws-sdk-polly (1.72.0)
53
+ aws-sdk-core (~> 3, >= 3.177.0)
43
54
  aws-sigv4 (~> 1.1)
44
- aws-sigv4 (1.5.2)
55
+ aws-sigv4 (1.6.0)
45
56
  aws-eventstream (~> 1, >= 1.0.2)
46
- axiom-types (0.1.1)
47
- descendants_tracker (~> 0.0.4)
48
- ice_nine (~> 0.11.0)
49
- thread_safe (~> 0.3, >= 0.3.1)
50
- bcrypt (3.1.18)
57
+ bcrypt (3.1.19)
51
58
  builder (3.2.4)
52
- coercible (1.0.0)
53
- descendants_tracker (~> 0.0.1)
54
59
  concurrent-ruby (1.2.2)
55
60
  connection_pool (2.4.0)
56
61
  crass (1.0.6)
@@ -61,8 +66,7 @@ GEM
61
66
  activerecord (>= 5.a)
62
67
  database_cleaner-core (~> 2.0.0)
63
68
  database_cleaner-core (2.0.1)
64
- descendants_tracker (0.0.4)
65
- thread_safe (~> 0.3, >= 0.3.1)
69
+ date (3.3.3)
66
70
  diff-lcs (1.5.0)
67
71
  discordrb (3.4.0)
68
72
  discordrb-webhooks (~> 3.3.0)
@@ -76,7 +80,25 @@ GEM
76
80
  domain_name (0.5.20190701)
77
81
  unf (>= 0.0.5, < 1.0.0)
78
82
  dotenv (2.8.1)
83
+ dry-core (1.0.0)
84
+ concurrent-ruby (~> 1.0)
85
+ zeitwerk (~> 2.6)
79
86
  dry-inflector (1.0.0)
87
+ dry-logic (1.5.0)
88
+ concurrent-ruby (~> 1.0)
89
+ dry-core (~> 1.0, < 2)
90
+ zeitwerk (~> 2.6)
91
+ dry-struct (1.6.0)
92
+ dry-core (~> 1.0, < 2)
93
+ dry-types (>= 1.7, < 2)
94
+ ice_nine (~> 0.11)
95
+ zeitwerk (~> 2.6)
96
+ dry-types (1.7.1)
97
+ concurrent-ruby (~> 1.0)
98
+ dry-core (~> 1.0)
99
+ dry-inflector (~> 1.0)
100
+ dry-logic (~> 1.4)
101
+ zeitwerk (~> 2.6)
80
102
  erubi (1.12.0)
81
103
  et-orbi (1.2.7)
82
104
  tzinfo
@@ -89,7 +111,7 @@ GEM
89
111
  railties (>= 5.0.0)
90
112
  faker (2.23.0)
91
113
  i18n (>= 1.8.11, < 2)
92
- faraday (2.7.4)
114
+ faraday (2.7.10)
93
115
  faraday-net_http (>= 2.0, < 3.1)
94
116
  ruby2_keywords (>= 0.0.4)
95
117
  faraday-multipart (1.0.4)
@@ -105,6 +127,8 @@ GEM
105
127
  fugit (1.8.1)
106
128
  et-orbi (~> 1, >= 1.2.7)
107
129
  raabro (~> 1.4)
130
+ globalid (1.1.0)
131
+ activesupport (>= 5.0)
108
132
  http (4.4.1)
109
133
  addressable (~> 2.3)
110
134
  http-cookie (~> 1.0)
@@ -116,7 +140,7 @@ GEM
116
140
  http-form_data (2.3.0)
117
141
  http-parser (1.2.3)
118
142
  ffi-compiler (>= 1.0, < 2.0)
119
- i18n (1.12.0)
143
+ i18n (1.13.0)
120
144
  concurrent-ruby (~> 1.0)
121
145
  ibm_cloud_sdk_core (1.1.3)
122
146
  concurrent-ruby (~> 1.0)
@@ -133,34 +157,49 @@ GEM
133
157
  jmespath (1.6.2)
134
158
  json (2.6.3)
135
159
  jwt (2.2.3)
136
- loofah (2.20.0)
160
+ loofah (2.21.3)
137
161
  crass (~> 1.0.2)
138
- nokogiri (>= 1.5.9)
139
- lucy_dockerunner (0.1.9)
162
+ nokogiri (>= 1.12.0)
163
+ lucy_dockerunner (0.2.0)
164
+ mail (2.8.1)
165
+ mini_mime (>= 0.1.1)
166
+ net-imap
167
+ net-pop
168
+ net-smtp
140
169
  method_source (1.0.0)
141
170
  mime-types (3.4.1)
142
171
  mime-types-data (~> 3.2015)
143
172
  mime-types-data (3.2023.0218.1)
144
- mini_portile2 (2.8.1)
173
+ mini_mime (1.1.2)
174
+ mini_portile2 (2.8.2)
145
175
  minitest (5.18.0)
146
176
  multi_json (1.15.0)
147
177
  multipart-post (2.3.0)
178
+ net-imap (0.3.6)
179
+ date
180
+ net-protocol
181
+ net-pop (0.1.2)
182
+ net-protocol
183
+ net-protocol (0.2.1)
184
+ timeout
185
+ net-smtp (0.3.3)
186
+ net-protocol
148
187
  netrc (0.11.0)
149
- nokogiri (1.14.3)
150
- mini_portile2 (~> 2.8.0)
188
+ nokogiri (1.15.2)
189
+ mini_portile2 (~> 2.8.2)
151
190
  racc (~> 1.4)
152
- nokogiri (1.14.3-x86_64-linux)
191
+ nokogiri (1.15.2-x86_64-linux)
153
192
  racc (~> 1.4)
154
193
  opus-ruby (1.0.1)
155
194
  ffi
156
195
  parallel (1.23.0)
157
- parser (3.2.2.0)
196
+ parser (3.2.2.1)
158
197
  ast (~> 2.4.1)
159
- pg (1.4.6)
198
+ pg (1.5.3)
160
199
  public_suffix (5.0.1)
161
200
  raabro (1.4.0)
162
201
  racc (1.6.2)
163
- rack (2.2.6.4)
202
+ rack (2.2.7)
164
203
  rack-test (2.1.0)
165
204
  rack (>= 1.3)
166
205
  rails-dom-testing (2.0.3)
@@ -168,13 +207,12 @@ GEM
168
207
  nokogiri (>= 1.6)
169
208
  rails-html-sanitizer (1.5.0)
170
209
  loofah (~> 2.19, >= 2.19.1)
171
- railties (7.0.4.3)
172
- actionpack (= 7.0.4.3)
173
- activesupport (= 7.0.4.3)
210
+ railties (6.1.7.3)
211
+ actionpack (= 6.1.7.3)
212
+ activesupport (= 6.1.7.3)
174
213
  method_source
175
214
  rake (>= 12.2)
176
215
  thor (~> 1.0)
177
- zeitwerk (~> 2.5)
178
216
  rainbow (3.1.1)
179
217
  rake (13.0.6)
180
218
  redis (5.0.6)
@@ -192,22 +230,22 @@ GEM
192
230
  rspec-core (~> 3.12.0)
193
231
  rspec-expectations (~> 3.12.0)
194
232
  rspec-mocks (~> 3.12.0)
195
- rspec-core (3.12.1)
233
+ rspec-core (3.12.2)
196
234
  rspec-support (~> 3.12.0)
197
- rspec-expectations (3.12.2)
235
+ rspec-expectations (3.12.3)
198
236
  diff-lcs (>= 1.2.0, < 2.0)
199
237
  rspec-support (~> 3.12.0)
200
238
  rspec-mocks (3.12.5)
201
239
  diff-lcs (>= 1.2.0, < 2.0)
202
240
  rspec-support (~> 3.12.0)
203
- rspec-rails (6.0.1)
241
+ rspec-rails (6.0.3)
204
242
  actionpack (>= 6.1)
205
243
  activesupport (>= 6.1)
206
244
  railties (>= 6.1)
207
- rspec-core (~> 3.11)
208
- rspec-expectations (~> 3.11)
209
- rspec-mocks (~> 3.11)
210
- rspec-support (~> 3.11)
245
+ rspec-core (~> 3.12)
246
+ rspec-expectations (~> 3.12)
247
+ rspec-mocks (~> 3.12)
248
+ rspec-support (~> 3.12)
211
249
  rspec-support (3.12.0)
212
250
  rubocop (1.50.2)
213
251
  json (~> 2.3)
@@ -219,13 +257,16 @@ GEM
219
257
  rubocop-ast (>= 1.28.0, < 2.0)
220
258
  ruby-progressbar (~> 1.7)
221
259
  unicode-display_width (>= 2.4.0, < 3.0)
222
- rubocop-ast (1.28.0)
260
+ rubocop-ast (1.28.1)
223
261
  parser (>= 3.2.1.0)
224
- rubocop-capybara (2.17.1)
262
+ rubocop-capybara (2.18.0)
225
263
  rubocop (~> 1.41)
226
- rubocop-rspec (2.20.0)
264
+ rubocop-factory_bot (2.22.0)
265
+ rubocop (~> 1.33)
266
+ rubocop-rspec (2.22.0)
227
267
  rubocop (~> 1.33)
228
268
  rubocop-capybara (~> 2.17)
269
+ rubocop-factory_bot (~> 2.22)
229
270
  ruby-progressbar (1.13.0)
230
271
  ruby2_keywords (0.0.5)
231
272
  rufus-scheduler (3.8.2)
@@ -251,14 +292,14 @@ GEM
251
292
  simplecov_json_formatter (0.1.4)
252
293
  streamio-ffmpeg (3.0.2)
253
294
  multi_json (~> 1.8)
254
- telegram-bot-ruby (0.23.0)
255
- dry-inflector
295
+ telegram-bot-ruby (1.0.0)
296
+ dry-struct (~> 1.6)
256
297
  faraday (~> 2.0)
257
298
  faraday-multipart (~> 1.0)
258
- virtus (~> 2.0)
259
- thor (1.2.1)
260
- thread_safe (0.3.6)
299
+ zeitwerk (~> 2.6)
300
+ thor (1.2.2)
261
301
  tilt (2.1.0)
302
+ timeout (0.3.2)
262
303
  tzinfo (2.0.6)
263
304
  concurrent-ruby (~> 1.0)
264
305
  unf (0.1.4)
@@ -266,10 +307,6 @@ GEM
266
307
  unf_ext (0.0.8.2)
267
308
  unicode-display_width (2.4.2)
268
309
  vcr (6.1.0)
269
- virtus (2.0.0)
270
- axiom-types (~> 0.1)
271
- coercible (~> 1.0)
272
- descendants_tracker (~> 0.0, >= 0.0.3)
273
310
  websocket (1.2.9)
274
311
  websocket-client-simple (0.6.1)
275
312
  event_emitter
@@ -277,43 +314,44 @@ GEM
277
314
  websocket-driver (0.7.5)
278
315
  websocket-extensions (>= 0.1.0)
279
316
  websocket-extensions (0.1.5)
280
- zeitwerk (2.6.7)
317
+ zeitwerk (2.6.8)
281
318
 
282
319
  PLATFORMS
283
320
  ruby
284
321
  x86_64-linux
285
322
 
286
323
  DEPENDENCIES
287
- activemodel
288
- activerecord
289
- activerecord-import
290
- activesupport
291
- awesome_chatgpt_actors
292
- aws-sdk-polly
293
- bcrypt
324
+ actionmailer (~> 6.1)
325
+ activemodel (~> 6.1)
326
+ activerecord (~> 6.1)
327
+ activerecord-import (~> 1.4)
328
+ activesupport (~> 6.1)
329
+ awesome_chatgpt_actors (~> 0.1)
330
+ aws-sdk-polly (~> 1.72)
331
+ bcrypt (~> 3.1)
294
332
  database_cleaner (~> 2.0)
295
333
  discordrb (~> 3.4)
296
- dotenv (~> 2.0)
297
- factory_bot_rails (~> 6.0)
298
- faker (~> 2.0)
299
- faraday
300
- ibm_watson
301
- lucy_dockerunner
302
- pg
334
+ dotenv (~> 2.8)
335
+ factory_bot_rails (~> 6.2)
336
+ faker (~> 2.23)
337
+ faraday (~> 2.7)
338
+ ibm_watson (~> 2.2)
339
+ lucy_dockerunner (~> 0.2)
340
+ pg (~> 1.5)
303
341
  rake (~> 13.0)
304
- redis
342
+ redis (~> 5.0)
305
343
  rspec (~> 3.12)
306
344
  rspec-rails (~> 6.0)
307
345
  rubocop (~> 1.50)
308
- rubocop-rspec (~> 2.20)
346
+ rubocop-rspec (~> 2.22)
309
347
  shoulda-matchers (~> 5.3)
310
- sidekiq
311
- sidekiq-expiring-jobs
312
- sidekiq-scheduler
313
- simplecov (~> 0.21)
314
- streamio-ffmpeg
315
- telegram-bot-ruby (~> 0.16)
316
- vcr (~> 6.0)
348
+ sidekiq (~> 7.0)
349
+ sidekiq-expiring-jobs (~> 0.1)
350
+ sidekiq-scheduler (~> 5.0)
351
+ simplecov (~> 0.22)
352
+ streamio-ffmpeg (~> 3.0)
353
+ telegram-bot-ruby (~> 1.0)
354
+ vcr (~> 6.1)
317
355
 
318
356
  BUNDLED WITH
319
357
  2.4.10
data/README.md CHANGED
@@ -4,16 +4,23 @@
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
  [![Ruby Version](https://img.shields.io/badge/Ruby-2.6.0%2B-blue.svg)](https://www.ruby-lang.org/en/)
6
6
 
7
- This Ruby gem provides an easy way to initialize a client for Telegram and Discord bots using the ChatGPT API, audio transcription, IBM Cloud Text to Speech, and AWS Polly, creating an assistant that can answer questions in text and voice and have a conversation with the user.
7
+ This Ruby gem provides an easy way to initialize a client for Telegram and Discord bots using the ChatGPT API, audio transcription, Text to Speech, creating an assistant that can answer questions in text and voice and have a conversation with the user.
8
+
9
+ #### Voice messages on telegram only - discord voice bot is not available and not planned to be implemented anymore
10
+ ##### Discord voice bot is been replaced by a voice assistant local packege to act like google assistant, alexa, siri, cortana, etc. The voice assistant is been developed to linux and android, but it can be ported to other platforms in the future.
11
+
12
+ #### Speech to Text services - OpenAI Audio Transcription
13
+ ##### More services will be added in the future
14
+ #### Text to Speech services - IBM Watson, AWS Polly, Azure Text to Speech
8
15
 
9
16
  #### Languages supported currently: en, pt
10
17
 
11
- Other contributions are welcome too!
12
- Remember to give a star to this repo if you like it!
18
+ #### Registration and Account Confirmation are avaiable on telegram only, sign in with the same credentials on discord after registering on telegram.
19
+
13
20
  ## Requirements
14
21
 
15
22
  - Ruby > 2.6.0 - for the gem who can create bots projects in your machine
16
- - Ruby 3.2.2 - inside the docker contianer or for run the bots in your machine
23
+ - Ruby 3.2.2 - inside the docker container or run the bots in your machine
17
24
  - Docker
18
25
  - Docker Compose
19
26
  - PostgreSQL
@@ -55,7 +62,7 @@ Make sure to run bundle before using the Lucy Dockerunner rake tasks.
55
62
 
56
63
  Then, edit the .env_sample file to include the necessary credentials and rename it to .env. Run bundle install to install the necessary dependencies.
57
64
 
58
- Remember to edit docker-compose.prod.yml when deploying to production.
65
+ Include `LUCY_SU=sudo` in your .env if u run docker compose with sudo
59
66
 
60
67
  ## Migrate your database
61
68
  ```bash
@@ -93,14 +100,13 @@ After starting the Docker Compose services, you can use the features of the gem
93
100
  The discord commands prefix can be changed in the .env file.
94
101
  The default prefix is !!
95
102
 
96
- - dgpt!start - shows the welcome message
97
- - dgpt!help - shows the help message
98
- - dgpt!login email:password - logs in the user. Remember to use private messages to register or login and share a server with right permissions with the bot to message it.
99
- - dgpt!register email:password - registers a new user, email is not verfied yet, so you can use any email, the password is encrypted with bcrypt and stored in the database with salt.
100
- - dgpt!list - lists the user created chatbots
101
- - dgpt!sl_chat CHAT TITLE - starts a chat with the chatbot with the given title
102
- - dgpt!new_chat CHAT TITLE - creates a new chatbot with the given title
103
- - dgpt!ask TEXT - sends a text to the chatbot
103
+ - !!start - shows the welcome message
104
+ - !!help - shows the help message
105
+ - !!login email:password - logs in the user. Remember to use private messages to register or login and share a server with right permissions with the bot to message it.
106
+ - !!list - lists the user created chatbots
107
+ - !!sl_chat CHAT TITLE - starts a chat with the chatbot with the given title
108
+ - !!new_chat CHAT TITLE - creates a new chatbot with the given title
109
+ - !!ask TEXT - sends a text to the chatbot
104
110
 
105
111
  ## Telegram Bot Commands
106
112
 
@@ -108,19 +114,13 @@ The default prefix is !!
108
114
  - /help - shows the help message
109
115
  - login/email:password - logs in the user. Remember to use private messages to register or login.
110
116
  - register/email:password - registers a new user, email is not verfied yet, so you can use any email, the password is encrypted with bcrypt and stored in the database with salt. Remember to use private messages to register or login.
117
+ - confirm/* name:token - confirms the user account. Remember to use private messages to register or login
111
118
  - list - lists the user created chatbots
112
119
  - sl_chat/CHAT TITLE - starts a chat with the chatbot with the given title
113
120
  - new_chat/CHAT TITLE - creates a new chatbot with the given title
114
121
  - TEXT - sends a text to the chatbot
115
122
  - VOICE_MESSAGE or AUDIO FILE - sends a voice message to the chatbot and returns the response in voice
116
123
 
117
- ## Recommended Actions runner
118
-
119
- You can run Github Actions workflows locally using [act](https://github.com/nektos/act)
120
-
121
- We recommend Act installation to run Github Actions workflows locally
122
- as we use it to deploy the bot in a server via ssh.
123
-
124
124
  ## Contributing
125
125
 
126
126
  A good way to contribute is add your language to DefaultMessages class in lib/chatgpt_assistant/default_messages.rb. You can also add your language to the list of languages in the README.md file.
@@ -139,7 +139,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/JesusG
139
139
  [![Activity map](https://images.repography.com/33522702/JesusGautamah/chatgpt_assistant/recent-activity/y6ZDduNWHwPzbnUFsmdGrJ99Q1vyEKGOBWFOBvzGjnM/1rZM2QrF0__3eUfUXFe6jDraYjHvypniTqDWhCequ-U_map.svg)](https://github.com/JesusGautamah/chatgpt_assistant/commits)
140
140
 
141
141
  ## Contributors
142
- - [Jesus Gautamah](https://github.com/JesusGautamah)
142
+ - [Jesus Gautamah](https://github.com/JesusGautamah)
143
143
 
144
144
  ## License
145
145
 
@@ -147,4 +147,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
147
147
 
148
148
  ## Code of Conduct
149
149
 
150
- Everyone interacting in the ChatgptAssistant project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/JesusGautamah/chatgpt_assistant/blob/master/CODE_OF_CONDUCT.md).
150
+ Everyone interacting in the ChatgptAssistant project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/JesusGautamah/chatgpt_assistant/blob/master/CODE_OF_CONDUCT.md).