chatgpt-rb 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/chatgpt-rb +4 -2
- data/lib/chatgpt_rb/conversation.rb +1 -1
- data/lib/chatgpt_rb/version.rb +3 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f4e1f6a8aea8a8fa06d4ebe9c35da19c8e7813c945a1ce534eeadd0e5088282
|
4
|
+
data.tar.gz: 611a070396c1c5006bd3df9b961dc2b2ed1a0fd3259626b4b38edbc2c08337c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2d583053bfb3700bda25d4416796997ce24c8acfd053deb34a639119b48aea90e555acb0edf4fd8c002e72716eb195629ee1b913ab6db06511d65457431c618
|
7
|
+
data.tar.gz: 3dc0bcfb0bb3eabc87972722ff617431349634c501406a02eada63bf61d03df5c9b05c515759db76e6ea119d85c7325781a8887f51ec802bde108eae15cb1e59
|
data/bin/chatgpt-rb
CHANGED
@@ -49,10 +49,12 @@ end.parse!
|
|
49
49
|
begin
|
50
50
|
puts "Type any message to talk with ChatGPT. Type '\\help' for a list of commands."
|
51
51
|
|
52
|
-
functions = options[:functions_files].
|
52
|
+
functions = options[:functions_files].flat_map do |function_file|
|
53
53
|
puts "Loading functions from #{function_file}"
|
54
54
|
|
55
|
-
ChatgptRb::
|
55
|
+
ChatgptRb::Conversation.new.tap do |conversation|
|
56
|
+
ChatgptRb::DSL::Conversation.new(conversation).instance_eval(File.read(function_file))
|
57
|
+
end.functions.values
|
56
58
|
end
|
57
59
|
|
58
60
|
messages = if options[:file]
|
@@ -35,7 +35,7 @@ module ChatgptRb
|
|
35
35
|
@prompt = prompt
|
36
36
|
@base_uri = base_uri
|
37
37
|
ChatgptRb::DSL::Conversation.configure(self, &configuration) if block_given?
|
38
|
-
@messages
|
38
|
+
@messages.unshift(role: "system", content: prompt) if prompt
|
39
39
|
end
|
40
40
|
|
41
41
|
# @param content [String]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chatgpt-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Breckenridge
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07
|
11
|
+
date: 2023-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
description: Provides libraries for interacting with the ChatGPT API and a CLI program
|
126
|
-
`chatgpt-rb` for live conversations.
|
126
|
+
`chatgpt-rb` for live conversations. Supports writing functions in Ruby.
|
127
127
|
email:
|
128
128
|
- aaron@breckridge.dev
|
129
129
|
executables:
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- lib/chatgpt_rb/dsl/parameter.rb
|
142
142
|
- lib/chatgpt_rb/function.rb
|
143
143
|
- lib/chatgpt_rb/parameter.rb
|
144
|
+
- lib/chatgpt_rb/version.rb
|
144
145
|
homepage: https://github.com/breckenedge/chatgpt-rb
|
145
146
|
licenses:
|
146
147
|
- MIT
|