openai-term 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/openai +6 -2
  3. metadata +6 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49d667fc72f329812fb5289172222b244948810773249bd01ecc9fef86979727
4
- data.tar.gz: 5d03c76031a4ac56ab2677bdf67988078318dc8dd4dc8ee11077cf8ff86c9991
3
+ metadata.gz: 9ceff9ceafa5d50d99036675fc0d85415da18a56e80bb0d6c0b408d4c6ca5325
4
+ data.tar.gz: d3b401c41cbb07d81d00877e4425c69c4630c5ccecd3f82be4e1082cb50ee408
5
5
  SHA512:
6
- metadata.gz: 126fdf6b1321c7e12303f8cb9b123fea6d9aac35bec04fe8ef8e3004d7344474126b8e95bb990e40ef29423bb34eba16283ee61da5a6e2b6d11938dc97065967
7
- data.tar.gz: bbfc821bbd75f0634f539fe82430344b08914c0e86a8b9230b131f614b8fc1ef5926fccb33444c22521a11acd4ec54aa3fb63feb3531ac75d73974093a90ff04
6
+ metadata.gz: 2c2796bf28a6de76dc9bde4db90772a1a360fa68c86c64b46c09fbe398177457574db59b4b0641fbee2ae9298734cf6d97e0ed8cb42c0a79eac84a1d452915ae
7
+ data.tar.gz: 3c95325c3e3d4103fb2bcfe2b4390cc491e4b603c7398059a5eacca5eb8e8ea243cbd56cb2644c7a432e2dda2e0a5d6de9c237d7ff674c2652263a2cbeab8343
data/bin/openai CHANGED
@@ -49,7 +49,7 @@ end
49
49
 
50
50
  # PROCESS QUERY
51
51
  if @f
52
- @q = File.read(f)
52
+ @q = File.read(@f)
53
53
  elsif @t
54
54
  @q = @t
55
55
  else
@@ -60,7 +60,11 @@ end
60
60
  # REQUEST RESPONSE
61
61
  client = OpenAI::Client.new(access_token: @ai)
62
62
 
63
- response = client.completions( parameters: { model: @m, prompt: @q, max_tokens: @x })
63
+ begin
64
+ response = client.completions( parameters: { model: @m, prompt: @q, max_tokens: @x })
65
+ rescue => error
66
+ p error
67
+ end
64
68
 
65
69
  #PRINT RESPONSE
66
70
  begin
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: 0.1.1
4
+ version: 0.1.3
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-01-25 00:00:00.000000000 Z
11
+ date: 2023-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-openai
@@ -38,10 +38,11 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.23'
41
- description: This is a pretty straight forward interface to OpenAI with the option
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
- 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.
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 0.1.3: Rescue error
45
+ on OpenAI connection.'
45
46
  email: g@isene.com
46
47
  executables:
47
48
  - openai