pato-gpt 0.1.8 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 803a9bbf9575b2c72f53329a4cb1643ca159091e9aed6b05ede53f82778867ce
4
- data.tar.gz: 305c0dbe27a2e83e45ae0f433a07426aeb8999db85465f94665fa81488dc0e93
3
+ metadata.gz: ebc8cef437d2c456f98cdb49d6fa8dd4c2f08fbe1f984f5466ca0fb2f8020342
4
+ data.tar.gz: 90a8bd191964ca7d8d06587fabbadc0604065630a7c1ee486068c67ada0959f0
5
5
  SHA512:
6
- metadata.gz: b9c1e607cf3f01be3f1c89417720fdb824600d8a11ea2acf3a8dbe3d32657f3f5b380fc652b0da6feddd88b7bbced74cc77bc2c0e4cc4a45294cc250054cc611
7
- data.tar.gz: e82a386b5830b72482173e6a96e21999069ea24ed4cead9192bf641c3f5e80ce2d2e4a04fd59ddc47c3082d9fadebe8377cacb4c8ebb123aef388b6f7b8318ca
6
+ metadata.gz: 6852264f713a6c0f8c189030a48c3dbc5dd68f330aa694f80542fbac9682edc417f767e78a2aa6fc713b65e1919f2967cb7a05e718c321be0fcfcd326a053e1f
7
+ data.tar.gz: 18c85dceac884a70d5753a1ef2b07f030f0b03f0e4f08889d0172ee7f9de6c01cea84e170194eb1248901db5e6b12f2050ba8e9aa055e414f4cffbf5675d2f68
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # PatoGpt
2
2
 
3
+ ![PatoGpt](patogpt.jpg)
3
4
 
4
5
  ## Installation
5
6
 
data/lib/patogpt.rb CHANGED
@@ -4,7 +4,7 @@ require 'tty-markdown'
4
4
  require 'pastel'
5
5
 
6
6
  class Patogpt
7
- def self.ask(q)
7
+ def self.ask(q, key)
8
8
  payload = {
9
9
  model: 'gpt-3.5-turbo',
10
10
  messages: [{ role: 'user', content: q }]
@@ -17,7 +17,7 @@ class Patogpt
17
17
 
18
18
  request = Net::HTTP::Post.new(uri)
19
19
  request["Content-Type"] = "application/json"
20
- request["Authorization"] = "Bearer #{ENV['OPENAI_API_KEY']}"
20
+ request["Authorization"] = "Bearer #{key}"
21
21
  request.body = JSON.generate(payload)
22
22
 
23
23
  response = https.request(request)
@@ -27,21 +27,12 @@ class Patogpt
27
27
  resp_json['choices'][0].dig('message', 'content')
28
28
  end
29
29
 
30
- def self.start(_args)
30
+ def self.start(key)
31
+ key = key || ENV['OPENAI_API_KEY']
31
32
  q = ''
32
33
 
33
34
  pastel = Pastel.new
34
35
 
35
- puts ' _____ _ _____ _ '
36
- puts ' | __ \ | | / ____| | | '
37
- puts ' | |__) |_ _| |_ ___ | | __ _ __ | |_ '
38
- puts ' | ___/ _` | __/ _ \| | |_ | '_ \| __|'
39
- puts ' | | | (_| | || (_) | |__| | |_) | |_ '
40
- puts ' |_| \__,_|\__\___/ \_____| .__/ \__|'
41
- puts ' | | '
42
- puts ' |_| '
43
- puts ''
44
-
45
36
  while true
46
37
  puts '..........................................................................................'
47
38
  puts ''
@@ -52,7 +43,7 @@ class Patogpt
52
43
  break if q == "exit"
53
44
 
54
45
  if q.strip.length > 0
55
- a = ask(q)
46
+ a = ask(q, key)
56
47
 
57
48
  puts ''
58
49
  print '@PatoGtp: '
data/pato-gpt.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "pato-gpt"
8
- spec.version = "0.1.8"
8
+ spec.version = "0.1.11"
9
9
  spec.authors = ["Andrew S Aguiar"]
10
10
  spec.email = ["andrewaguiar6@gmail.com"]
11
11
  spec.summary = 'Pato assistente'
data/patogpt.jpg ADDED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pato-gpt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew S Aguiar
@@ -60,6 +60,7 @@ files:
60
60
  - generate-gem
61
61
  - lib/patogpt.rb
62
62
  - pato-gpt.gemspec
63
+ - patogpt.jpg
63
64
  homepage: https://github.com/andrewaguiar/patogpt
64
65
  licenses:
65
66
  - MIT