simple-openai-client 1.0.3 → 1.0.4

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: 8f74224909a064fa0ba25d56108c5bc5b25dfd0401c4e3c7079d1c3dbe083666
4
- data.tar.gz: 7e6beb0d851934c9565591520037c17d8708f678389dcdfaaf71a1b7dd911183
3
+ metadata.gz: c14118266582c1aab20eaf87badf7ecbd547e97040eabe674ce7b118d1945352
4
+ data.tar.gz: 1b3f51fac5d7be0160aeb5f5939e78ad175a414824081d20c2401765ae47a675
5
5
  SHA512:
6
- metadata.gz: 85019b0bf9eec3256e428101157aaec486783b48c50159de6b07d0e661c83205facfc3c72652bf9abebc129d4f48b6b59200480ec755a186c4780eefc4b814e0
7
- data.tar.gz: 4c7dd3ac4c6307af55fc78029004e0997f95a97756f3a43b3426b5f6d241090d5c2cac9d4b17ab4d6bc836fe1b35967ad55f9c949344bf796b3bb88d2ac984c1
6
+ metadata.gz: 8e082c4e9176c5a87d7d56d1ceb7756473b280cf84eb93d7f375a018dbf64dfe24969e6ecd9efe3b0366592c6ec0ef8692e73ebc198f0b37195f22c89e0f7163
7
+ data.tar.gz: 2a9eeb217d03d5e5d90a4855601bc69903398bfc40354a628c4abd65a8fb6d24c2818d848e6bed1f0fbbf461fbc6704177acb79fc44c592236a339ff76f5422b
@@ -5,6 +5,7 @@
5
5
  require 'net/http'
6
6
  require 'uri'
7
7
  require 'json'
8
+ require 'colorize'
8
9
 
9
10
  class OpenAIClient
10
11
  attr_accessor :api_key, :model, :messages, :functions, :callbacks, :version
@@ -69,7 +70,11 @@ class OpenAIClient
69
70
  # If you want the model to call a function explicitly, you can add: "function_call" => "auto"
70
71
  }
71
72
 
72
- request_body["functions"] = self.functions if self.functions.size > 0
73
+ if self.functions.size > 0
74
+ request_body["functions"] = self.functions
75
+ # Important: enable function-calling
76
+ request_body["function_call"] = "auto"
77
+ end
73
78
 
74
79
  http = Net::HTTP.new(uri.host, uri.port)
75
80
  http.use_ssl = true
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'simple-openai-client'
3
- s.version = '1.0.3'
4
- s.date = '2025-01-05'
3
+ s.version = '1.0.4'
4
+ s.date = '2025-01-18'
5
5
  s.summary = "Very simple Ruby library for operating OpenAI API for building Agents."
6
6
  s.description = "Very simple Ruby library for operating OpenAI API for building Agents."
7
7
  s.authors = ["Leandro Daniel Sardi"]
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-openai-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-01-05 00:00:00.000000000 Z
10
+ date: 2025-01-18 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: uri
@@ -142,7 +141,6 @@ homepage: https://github.com/leandrosardi/simple-openai-client
142
141
  licenses:
143
142
  - MIT
144
143
  metadata: {}
145
- post_install_message:
146
144
  rdoc_options: []
147
145
  require_paths:
148
146
  - lib
@@ -157,8 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
155
  - !ruby/object:Gem::Version
158
156
  version: '0'
159
157
  requirements: []
160
- rubygems_version: 3.3.7
161
- signing_key:
158
+ rubygems_version: 3.6.3
162
159
  specification_version: 4
163
160
  summary: Very simple Ruby library for operating OpenAI API for building Agents.
164
161
  test_files: []