openai-term 1.1.0 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/openai +4 -3
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2abbfbe3ddbb58ef646c947ae95b0f7e3b4b2cfa66504da56f7a6287fee6a937
|
4
|
+
data.tar.gz: 570cda81a17af2ff1205dbabbf891fcc523dd02b278ec4844be0fe367f69d302
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 547bc0aa770e8b38d2bfca522bfd96ab2b8f6ee5a88dcf0a4648f7dc4c6666063115727b45c12dff7d365ff1e064af7dc523ded1da6a289c123089be6c118dbd
|
7
|
+
data.tar.gz: bddf59959dd6a3f94dbeadcc3ab6d52adde712168c7c10643311f192528963811d1f8fced468e87ccbc26de9e0c71be18920d0c3b6af6969b5b0e0c70bf011fe
|
data/bin/openai
CHANGED
@@ -45,8 +45,8 @@ end
|
|
45
45
|
|
46
46
|
# PROCESS QUERY
|
47
47
|
@q = ""
|
48
|
-
@q += @t if @t
|
49
48
|
@q += File.read(@f) if @f
|
49
|
+
@q += @t if @t
|
50
50
|
unless @f or @t
|
51
51
|
puts "You must supply a query in form of a text file (option -f file) and/or text (option -t text)\n\n"
|
52
52
|
exit
|
@@ -64,8 +64,9 @@ begin
|
|
64
64
|
response = client.completions( parameters: { model: @m, prompt: @q, max_tokens: @x })
|
65
65
|
begin
|
66
66
|
output = response["choices"][0]["text"]
|
67
|
-
rescue
|
68
|
-
|
67
|
+
rescue => error
|
68
|
+
p error
|
69
|
+
output = response["error"]["message"]
|
69
70
|
end
|
70
71
|
puts output.strip + "\n\n"
|
71
72
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openai-term
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-openai
|
@@ -41,9 +41,8 @@ dependencies:
|
|
41
41
|
description: 'This is a pretty straight forward interface to OpenAI with the option
|
42
42
|
to select the AI model and the maximum token length (number of maximum words in
|
43
43
|
the AI''s response). You will use the -t option to supply the query to OpenAI or
|
44
|
-
the -f option to read the query from a text file instead. New in 1.
|
45
|
-
|
46
|
-
combine the two to e.g. ask openai to describe the content of a file).'
|
44
|
+
the -f option to read the query from a text file instead. New in 1.2: Made openai
|
45
|
+
read -f file first, then -t text.'
|
47
46
|
email: g@isene.com
|
48
47
|
executables:
|
49
48
|
- openai
|