rubyai 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rubyai.rb +3 -3
  3. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d773991eb859ade93ab2fd3cf021e35d5739d9b21b151650a1acf4966bd27c3d
4
- data.tar.gz: 8d0cc8d3d2a754f9ce248db8bc0ca438c6ef5c1309508633f2cce7ac021966d1
3
+ metadata.gz: 6aaf45f7111b134e2c41686e8e2d9a015ad4ae4b1daea7c40ccdee91ad9e1a9d
4
+ data.tar.gz: 1a3d06462238a09bf79c0130d32c85641227980f5ebeaacb3c6032d98f89f7c5
5
5
  SHA512:
6
- metadata.gz: c543eeb52f3ecc0b5e9cf9d4f024cf11838fec17b3d63d5267eace99ac7006cebe9848ae8669e687ff57af7d18a2775e3e8efcad90f4424559045235987a7e06
7
- data.tar.gz: e81f2c6845ee87c7e251f905491829be84d22aff5fd8b96238ccb7f3384dae21e607d2021aed7035bae64cd0956bdac38bbc516a60f48796de072e404c196fcf
6
+ metadata.gz: 4421d6f50f2dd0e9fdb228370f09fea776862eecbcc6ee3f64058d096946dde41fd23c59c2e242d06d4c1900e2f969168c2050ff19a94079b1de665c60521edb
7
+ data.tar.gz: 4f0925897be5d9314e99d64e2b59f8b028623eda7ec6ff9398972c2cb84d2c7a82b84f293167f7eca4061f64a4fe72ca39135c1741b0379400393fb68d1b64e5
data/lib/rubyai.rb CHANGED
@@ -8,11 +8,11 @@ module RubyAI
8
8
  class Client
9
9
  BASE_URL = URI.parse("https://api.openai.com/v1/chat/completions")
10
10
 
11
- def initialize(api_key, model, messages, temperature)
11
+ def initialize(api_key, messages, temperature: 0.7, model: "gpt-3.5-turbo")
12
12
  @api_key = api_key
13
- @model = model
14
13
  @messages = messages
15
14
  @temperature = temperature
15
+ @model = model
16
16
  end
17
17
 
18
18
  attr_accessor :api_key, :model, :messages, :temperature
@@ -32,7 +32,7 @@ module RubyAI
32
32
  def body
33
33
  {
34
34
  'model': model,
35
- 'messages': messages,
35
+ 'messages': [{"role": "user", "content": messages}],
36
36
  'temperature': temperature
37
37
  }
38
38
  end
metadata CHANGED
@@ -1,23 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
- - Alex Shaplov
7
+ - Alex Shapalov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-20 00:00:00.000000000 Z
11
+ date: 2023-03-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: A Ruby gem for the OpenAI GPT-3 API
13
+ description:
14
14
  email:
15
15
  executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/rubyai.rb
20
- homepage: https://rubygems.org/gems/rubyai
20
+ homepage: https://github.com/alexshapalov/rubyai
21
21
  licenses:
22
22
  - MIT
23
23
  metadata: {}
@@ -39,5 +39,5 @@ requirements: []
39
39
  rubygems_version: 3.2.33
40
40
  signing_key:
41
41
  specification_version: 4
42
- summary: Hola!
42
+ summary: A Ruby gem for the OpenAI GPT-3 API
43
43
  test_files: []