openai-term 1.1.0 → 1.1.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/openai +3 -2
  3. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 530ec219ffa111a4c438093a26773103d987fb6d856e97332fa8b868b82e9d8e
4
- data.tar.gz: 577408b5babe6504ef2e12dc96c214163c34fd70e619ce0b7bdc7d5ec92daa95
3
+ metadata.gz: 7807f8bc3c8150a78ad1bd08c3995c63f5767c7c403332184eb53657e234395c
4
+ data.tar.gz: 9a410c45e8f255e723bc7ed9022eb019d612f0caf4faf6eeafc4b8a8df696e93
5
5
  SHA512:
6
- metadata.gz: c02abaa82d7ebb2013dd05965c2f6700849dfcb921847b12bf5a483380eb7d5487069a319ee18d9932b920d04dbe1874b7f3b89753c922f73680f53d9e1fe8d0
7
- data.tar.gz: 0ef0c53ea3542fa61dd235773658c12f3f9f27d2792b085d380e6de9ecc732cc1365b6c1f490c67df904ea87383b3ab2a93fa4398af55837e6c5ddc8a4f95e59
6
+ metadata.gz: 511193fd306c068eced18f852b27fff11b7b92507074f8d28857bdaa86f5183e68170c3a61e1fe8fafc1daa9a64ba3c0ac961aa35619f8475314f92231f2fe01
7
+ data.tar.gz: bb7be835e14c8dc9084b82edc58b72b48ca19442be7d85182cc3be2c0d26a3538e6fa9277b02ad005d796bfb94e78696b504cd2aa6b06f9b76224762c0218e36
data/bin/openai CHANGED
@@ -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
- output = "No OpenAI response"
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openai-term
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -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.1.0: Added the
45
- opportunity to supply both a text (-t) and a text file (-f) as a query (you can
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.1.1: Better
45
+ error handling.'
47
46
  email: g@isene.com
48
47
  executables:
49
48
  - openai