chatgpt2023 0.5.0 → 0.5.1
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
- checksums.yaml.gz.sig +0 -0
- data/lib/chatgpt2023.rb +20 -2
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f937d13ec5131003c4acf2b9c046cb56e4462bb72e89700cb56fb2c376c3846
|
4
|
+
data.tar.gz: e2252feb992e7c3538ae917d63abc6b4f4743e8faa328fff0ce36f1af221508e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88b1657db3ac774bfae4df8166a2aa26ef520af5194a7ba1718aea6612a2a75350de457b8dabb150bda4e149a4851648f45eecfdc1dd6276794fdb1358c760a5
|
7
|
+
data.tar.gz: dd610445a564e33fde61cdedda227a843d6410457f90b8a85b3255e627462fb51cae5a3767d56e6346f277466df97053fd3f41155fba06d7fbbd34d4e125144c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/chatgpt2023.rb
CHANGED
@@ -79,7 +79,16 @@ class ChatGpt2023
|
|
79
79
|
|
80
80
|
def chats(s=nil, messages: [], temperature: 1, max_tokens: 3900, n: 1)
|
81
81
|
|
82
|
-
|
82
|
+
if @assistant_recent then
|
83
|
+
|
84
|
+
# We limit what gets passed back because there should enough
|
85
|
+
# information in the 1st 140 chars to infer the conversation context
|
86
|
+
#
|
87
|
+
@assistant_recent[:content].slice!(140..-1)
|
88
|
+
messages << @assistant_recent
|
89
|
+
max_tokens -= @assistant_recent[:content].split.length
|
90
|
+
end
|
91
|
+
|
83
92
|
messages << {'role' => 'user', 'content' => s } if s
|
84
93
|
r = go_chat(messages, temperature: temperature,
|
85
94
|
max_tokens: max_tokens, n: n)
|
@@ -296,6 +305,15 @@ class CGRecorder < ChatGpt2023
|
|
296
305
|
|
297
306
|
end
|
298
307
|
|
308
|
+
def chat(s, tags=nil, temperature: 1, max_tokens: 1000)
|
309
|
+
|
310
|
+
r = super(s, temperature: temperature, max_tokens: max_tokens)
|
311
|
+
puts 'CGRecorder inside chat: ' + r.inspect if @debug
|
312
|
+
log(s, r[:text].strip, tags) unless r[:error]
|
313
|
+
|
314
|
+
return r
|
315
|
+
end
|
316
|
+
|
299
317
|
def code_completion(s, tags=nil, temperature: 1, max_tokens: 2000)
|
300
318
|
|
301
319
|
r = super(s, temperature: temperature, max_tokens: max_tokens)
|
@@ -312,8 +330,8 @@ class CGRecorder < ChatGpt2023
|
|
312
330
|
log(s, r[:text].strip, tags) unless r[:error]
|
313
331
|
|
314
332
|
return r
|
315
|
-
|
316
333
|
end
|
334
|
+
|
317
335
|
|
318
336
|
alias complete completion
|
319
337
|
alias ask completion
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chatgpt2023
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
6FQD1/GISew7VvxUJdptXeuVNIsdNKxvL3RpfLCuFsi1WXyJ4k3odRMTmS0kAfTy
|
37
37
|
J4sZZW9RNfabTMQQY7DIs3tUAn6i+O0r9lo=
|
38
38
|
-----END CERTIFICATE-----
|
39
|
-
date: 2023-03-
|
39
|
+
date: 2023-03-13 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: down
|
metadata.gz.sig
CHANGED
Binary file
|