chatgpt-rb 0.1.5 → 0.1.6

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: 4833d50d716b3f34e13dc2936f3b837ff0346ecfe35d42c2755f1c0d48989883
4
- data.tar.gz: c2220ac57c216ea81125552274e65567b4076b127acdc1d62a54daaa427a665f
3
+ metadata.gz: 9c3a20f294a53407477460d0bcf1efc53524a4986cf1129c365f597a93766adc
4
+ data.tar.gz: 75999a3494afb6b8726a1510c6e16ec29e8dc55015212175befef7f5fac3a766
5
5
  SHA512:
6
- metadata.gz: dc3972ef878ce27bb6576bbc7fcc9e39cbdb364abfa35b762fd7bb2e77b4d025389300630953c8ea8e1d88b7d57af7979116a4af1b63639ddaf3ecd7ad16adee
7
- data.tar.gz: 8bb0f8541137f062bdbf716cb1de37114186caaa4d0bcd279ac4cda0d892698b454862af25f923dc854a870defef2425a3c891c5df5fcfd4a222e82e006d39be
6
+ metadata.gz: 5a4aaa0890191fdd4c4b5221c49a3ce094e4d69f0ffd699207fa8987515fb4e12dd6ffcb349cd2015205e99ee65660b57c72f7c8c05e6a471703d557f50dbcaa
7
+ data.tar.gz: 409b9eb640141bdd46ebbaf8b131c43b8f72d6e1e3b4da75c0f729ff9cf5bba1cb2b87a2536ddcf4fc906f6008f360a8694a5029ba57f43d55263f08783e10c6
data/bin/chatgpt-rb CHANGED
@@ -11,6 +11,7 @@ options = {
11
11
  model: "gpt-3.5-turbo",
12
12
  base_uri: "https://api.openai.com/v1",
13
13
  functions_files: [],
14
+ temperature: 0.7,
14
15
  }
15
16
 
16
17
  OptionParser.new do |opts|
@@ -39,6 +40,10 @@ OptionParser.new do |opts|
39
40
  opts.on("-p", "--prompt PROMPT", "Declare the PROMPT for your conversation") do |prompt|
40
41
  options[:prompt] = prompt
41
42
  end
43
+
44
+ opts.on("-t", "--temperature TEMPERATURE", "Set the temperature for the conversation") do |temperature|
45
+ options[:temperature] = temperature.to_f
46
+ end
42
47
  end.parse!
43
48
 
44
49
  begin
@@ -61,10 +66,11 @@ begin
61
66
  end
62
67
 
63
68
  if options[:prompt]
69
+ options[:prompt] = File.exist?(options[:prompt]) ? File.read(options[:prompt]) : options[:prompt]
64
70
  puts "prompt> ".colorize(:blue) + options[:prompt]
65
71
  end
66
72
 
67
- conversation = ChatgptRb::Conversation.new(api_key: options.fetch(:key), model: options.fetch(:model), base_uri: options.fetch(:base_uri), messages:, functions:, prompt: options[:prompt])
73
+ conversation = ChatgptRb::Conversation.new(api_key: options.fetch(:key), model: options.fetch(:model), base_uri: options.fetch(:base_uri), messages:, functions:, prompt: options[:prompt], temperature: options.fetch(:temperature))
68
74
 
69
75
  commands = [
70
76
  {
@@ -1,3 +1,3 @@
1
1
  module ChatgptRb
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
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.5
4
+ version: 0.1.6
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-08-30 00:00:00.000000000 Z
11
+ date: 2023-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty