chat_gpt_client 0.1.0 → 0.1.1

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: f7641c9f199e34018c618fda5d669b58a6ca5ae5c727d72aebe1587beb0d7b82
4
- data.tar.gz: ad2f1f30e8b3b766310d403646e872f38bdbd823d9110abc15d6cdcea95d32e5
3
+ metadata.gz: 59c26df8d1c546231a9d61f1ce2a5edd9120b5145735c4f2b49ab817816294b9
4
+ data.tar.gz: 222bf04989aa046aca57a560441c78c1301bfa72a3eab515e7182fa9af846d29
5
5
  SHA512:
6
- metadata.gz: 2bd0344f4af641f8fc9d96c8d771df55e9eb7852365c7a8b559e6ab4dfc70f8a9fcd9daf5f8881652753afb1a0bc9ea6495c14e72808312e5fd97686687d691c
7
- data.tar.gz: f570d3e7f136eb8e7725e1f1b4ab80d431faddd550526e1ba67ddc782d3af2a169a7bf3775f6fc99fa6bb3dfe12fed65a4cb84f56530600c59ca25e5e66e2401
6
+ metadata.gz: 43a53ed20cc8b199f750e3727fe3aabc22dfc67a80a099662c55bc604a0e1b22713a0d99e76875d597ed4f57e3ea35fd1b5039921f0a91f91a76be4f92f97061
7
+ data.tar.gz: bef11e29cede10873df76443e10bb20d895e40b82acafb5f61d346d0545f845bf2887ed4574aa2012bf65e452d3346c27f77603e87cc25e9e4bea166a81a072b
data/Gemfile.lock CHANGED
@@ -44,6 +44,7 @@ GEM
44
44
 
45
45
  PLATFORMS
46
46
  x86_64-darwin-21
47
+ x86_64-linux
47
48
 
48
49
  DEPENDENCIES
49
50
  chat_gpt_client!
@@ -5,7 +5,7 @@ module ChatGPT
5
5
  class Client
6
6
  def initialize(api_key: ENV["OPENAI_API_KEY"], system_prompt: nil)
7
7
  if api_key.nil? || api_key.empty?
8
- raise Error, "You must provide an API token or set the OPENAI_API_KEY environment variable"
8
+ raise ChatGPT::Error, "You must provide an API token or set the OPENAI_API_KEY environment variable"
9
9
  end
10
10
 
11
11
  @api_key = api_key
@@ -58,7 +58,7 @@ module ChatGPT
58
58
  end
59
59
 
60
60
  def extract_response(response)
61
- raise Error, "Error: #{response.code} - #{response.body}" unless response.code == "200"
61
+ raise ChatGPT::Error, "Error: #{response.code} - #{response.body}" unless response.code == "200"
62
62
 
63
63
  JSON.parse(response.body)
64
64
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChatGPT
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chat_gpt_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Boffa