open_ai_bot 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/open_ai/chat_gpt.rb +1 -0
- data/lib/open_ai/chat_thread.rb +1 -2
- data/lib/open_ai/model.rb +3 -1
- data/open_ai_bot.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e31ed7bc34cf94ba2d339a1efa6b57a0d9fd972aec39961a98253cb5b9dcc4df
|
4
|
+
data.tar.gz: 2f92b54b9788efacd9bf50b66004c777a8eeb3bd934ffc65a2ea93a4a12c39e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38ff4646a9493b2771d62cce25d8a2ff0ab589bc2d300041fec4536e6e75065e33c79fe452994dd5d9a628be6646e4ed97bb97a7c28503811b3a3db1b8fefa9f
|
7
|
+
data.tar.gz: 872adfdeb95db9ccbdd8073ee736136a40d4517b1b4eddee9ddf5885638dfe286c705554dd708c654dd1e9b83c62682626fd63cf3d2e878fea536a4d79c08d67
|
data/lib/open_ai/chat_gpt.rb
CHANGED
@@ -8,6 +8,7 @@ module OpenAI
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_thread(chat_id, model = nil)
|
11
|
+
model ||= config.open_ai["chat_gpt_model"].to_sym
|
11
12
|
msgs = config.open_ai["whitelist"].include?(chat_id) ? initial_messages : []
|
12
13
|
new_thread = ChatThread.new(msgs, model)
|
13
14
|
threads[chat_id] = new_thread
|
data/lib/open_ai/chat_thread.rb
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
|
3
3
|
module OpenAI
|
4
4
|
class ChatThread
|
5
|
-
def initialize(defaults = [], model
|
6
|
-
model ||= OpenAIBot.config.open_ai["chat_gpt_model"].to_sym
|
5
|
+
def initialize(defaults = [], model)
|
7
6
|
@history ||= defaults
|
8
7
|
@model = model.is_a?(Model) ? model : Model.new(model)
|
9
8
|
puts @history
|
data/lib/open_ai/model.rb
CHANGED
data/open_ai_bot.gemspec
CHANGED