chat_gpt_client 0.1.1 → 0.2.0

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: 59c26df8d1c546231a9d61f1ce2a5edd9120b5145735c4f2b49ab817816294b9
4
- data.tar.gz: 222bf04989aa046aca57a560441c78c1301bfa72a3eab515e7182fa9af846d29
3
+ metadata.gz: 63a9663535742a12f4720e60dfac2589c7cfcf02ffe9c63813aa06cb7b9335e2
4
+ data.tar.gz: 6a1d4649a5ef6ba7ed711f1ba15f905e8b24e913f1224360d3070c2a372ac1c9
5
5
  SHA512:
6
- metadata.gz: 43a53ed20cc8b199f750e3727fe3aabc22dfc67a80a099662c55bc604a0e1b22713a0d99e76875d597ed4f57e3ea35fd1b5039921f0a91f91a76be4f92f97061
7
- data.tar.gz: bef11e29cede10873df76443e10bb20d895e40b82acafb5f61d346d0545f845bf2887ed4574aa2012bf65e452d3346c27f77603e87cc25e9e4bea166a81a072b
6
+ metadata.gz: 6f7331daaa81a07cef793599a7026f4b73898574dde43fd60cc6f69b553b7102fda812fed5a78567ec9100c26a1dff4df4794c5e7cdbe889bf06b8b5eb7428a7
7
+ data.tar.gz: 3bbb94c0d72d0f9fbf5c83794a827c7470c6fc31e9ca83f0615274388511e070093c834b5668ecffee1272e0d8157985026ae19ed1186c81fc41de5950c699af
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chat_gpt_client (0.1.0)
4
+ chat_gpt_client (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -3,13 +3,14 @@
3
3
  module ChatGPT
4
4
  # The client for the OpenAI ChatGPT API
5
5
  class Client
6
- def initialize(api_key: ENV["OPENAI_API_KEY"], system_prompt: nil)
6
+ def initialize(api_key: ENV["OPENAI_API_KEY"], system_prompt: nil, temperature: nil)
7
7
  if api_key.nil? || api_key.empty?
8
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
12
12
  @system_prompt = system_prompt
13
+ @temperature = temperature
13
14
  @history = []
14
15
  end
15
16
 
@@ -66,7 +67,8 @@ module ChatGPT
66
67
  def build_body
67
68
  {
68
69
  model: "gpt-3.5-turbo",
69
- messages: history
70
+ messages: history,
71
+ temperature: @temperature
70
72
  }
71
73
  end
72
74
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChatGPT
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
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.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Boffa