openai_chatgpt 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: 35a7ddb611ab54537073b7230cd837cba5baa8db5a604a188cdddeda168638d3
4
- data.tar.gz: da5d5bfc63d3065eedaa0380de6bbeb6948744ea611c5597efb84bfce8e8e5a8
3
+ metadata.gz: e28eb9053bc4d6de69fb263fec32f4192e64b0884db832e99aa4eb5933b80276
4
+ data.tar.gz: b289590ccb8f50edd42863eca80c82176f4af41f73b4b5aa8891b55b02d733c3
5
5
  SHA512:
6
- metadata.gz: e4dc88f770b1d259922afa8c4136f69db7996374a0fa85befad81b9a3864f353f13eb9cc8eef507c244660112a368cec1ff69df83be021b5b3185312aef5c53d
7
- data.tar.gz: 0cc811e6103078c8ba3a950f7c76cc25273a20b818a932d185c6e7dfe903375fea3c02f5fbea07e3858e67780d392eae08c0aa3f7e6470af8fa10b36c2010f6c
6
+ metadata.gz: 904b4a01865ff5cea4e965567be2962673425d9bcabb50b8eb2479e6fdb73f8402f2d0ad4907f0846009a268c43fb8d8f9804accaf69be319780d8384c845809
7
+ data.tar.gz: 4e325580d33d22b8753ba1957376edd6248797f33f987130efaa6831caf8b5693f7e7b8071a4948b66935090d2dc1da9e991170c2c9a3125e05e8cf891b269d4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.1.1] - 2022-03-24
2
+
3
+ - added `timeout` option to faraday connection by [@mennovergeer](https://github.com/mennovergeer)
4
+
1
5
  ## [0.1.0] - 2022-03-06
2
6
 
3
7
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openai_chatgpt (0.1.0)
4
+ openai_chatgpt (0.1.1)
5
5
  faraday (~> 2.5)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OpenaiChatgpt
2
2
 
3
- OpenAI ChatGPT API is a light-weight Ruby wrapper for the Rubyists. It gives nice struct objects for adresses, even the raw responses are returned in nice open struct objects. It uses Faraday for HTTP requests.
3
+ OpenAI ChatGPT API is a light-weight Ruby wrapper for the Rubyists. It gives nice struct objects for completions of the chatgpt, even the raw responses are returned in nice open struct objects. It uses Faraday for HTTP requests.
4
4
 
5
5
  ## Installation
6
6
 
@@ -97,7 +97,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
97
97
 
98
98
  ## Contributing
99
99
 
100
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/openai_chatgpt. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/openai_chatgpt/blob/main/CODE_OF_CONDUCT.md).
100
+ Bug reports and pull requests are welcome on GitHub at https://github.com/sulmanweb/openai_chatgpt. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/sulmanweb/openai_chatgpt/blob/main/CODE_OF_CONDUCT.md).
101
101
 
102
102
  ## License
103
103
 
@@ -105,4 +105,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
105
105
 
106
106
  ## Code of Conduct
107
107
 
108
- Everyone interacting in the OpenaiChatgpt project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/openai_chatgpt/blob/main/CODE_OF_CONDUCT.md).
108
+ Everyone interacting in the OpenaiChatgpt project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/sulmanweb/openai_chatgpt/blob/main/CODE_OF_CONDUCT.md).
@@ -100,7 +100,7 @@ module OpenaiChatgpt
100
100
  @connection ||= Faraday.new(BASE_URL) do |conn|
101
101
  conn.headers["Authorization"] = "Bearer #{@api_key}"
102
102
  conn.headers["Content-Type"] = "application/json"
103
-
103
+ conn.options.timeout = 120 # Increase the timeout limit to 120 seconds
104
104
  conn.response :json, content_type: "application/json"
105
105
  conn.adapter adapter, @stubs
106
106
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenaiChatgpt
4
- # Address object
4
+ # Usage object
5
5
  class Usage
6
6
  attr_reader :prompt_tokens, :completion_tokens, :total_tokens
7
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenaiChatgpt
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/openai_chatgpt/version"
4
+
5
+ # rubocop:disable Metrics/BlockLength
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "openai_chatgpt"
8
+ spec.version = OpenaiChatgpt::VERSION
9
+ spec.authors = ["Sulman Baig"]
10
+ spec.email = ["sulman@hey.com"]
11
+
12
+ spec.summary = "OpenAI ChatGPT API is a light-weight Ruby wrapper for the Rubyists. gpt-3.5-turbo, gpt-3.5-turbo-0301"
13
+ spec.description = "OpenAI ChatGPT API is a light-weight Ruby wrapper for the Rubyists. gpt-3.5-turbo,\
14
+ gpt-3.5-turbo-0301. You can use this gem to generate text using OpenAI's ChatGPT chat responses API."
15
+ spec.homepage = "https://github.com/sulmanweb/openai_chatgpt"
16
+ spec.license = "MIT"
17
+ spec.required_ruby_version = ">= 2.6"
18
+
19
+ # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
20
+
21
+ spec.metadata["homepage_uri"] = spec.homepage
22
+ spec.metadata["source_code_uri"] = "https://github.com/sulmanweb/openai_chatgpt"
23
+ spec.metadata["changelog_uri"] = "https://github.com/sulmanweb/openai_chatgpt/blob/main/CHANGELOG.md"
24
+
25
+ # Specify which files should be added to the gem when it is released.
26
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
+ spec.files = Dir.chdir(__dir__) do
28
+ `git ls-files -z`.split("\x0").reject do |f|
29
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
30
+ end
31
+ end
32
+ spec.bindir = "exe"
33
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
34
+ spec.require_paths = ["lib"]
35
+ spec.extra_rdoc_files = %w[README.md]
36
+
37
+ spec.add_dependency("faraday", "~> 2.5")
38
+ spec.add_development_dependency("rubocop", "~> 1.35")
39
+ spec.metadata["rubygems_mfa_required"] = "true"
40
+ end
41
+ # rubocop:enable Metrics/BlockLength
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openai_chatgpt
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
  - Sulman Baig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-06 00:00:00.000000000 Z
11
+ date: 2023-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -62,6 +62,7 @@ files:
62
62
  - lib/openai_chatgpt/response.rb
63
63
  - lib/openai_chatgpt/usage.rb
64
64
  - lib/openai_chatgpt/version.rb
65
+ - openai_chatgpt.gemspec
65
66
  - sig/openai_chatgpt.rbs
66
67
  homepage: https://github.com/sulmanweb/openai_chatgpt
67
68
  licenses:
@@ -86,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
87
  - !ruby/object:Gem::Version
87
88
  version: '0'
88
89
  requirements: []
89
- rubygems_version: 3.4.1
90
+ rubygems_version: 3.4.8
90
91
  signing_key:
91
92
  specification_version: 4
92
93
  summary: OpenAI ChatGPT API is a light-weight Ruby wrapper for the Rubyists. gpt-3.5-turbo,