intelli_agent 0.1.3 → 0.1.4

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/intelli_agent/openai.rb +7 -21
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cb37d7cb52a2574978fbf164f5b9eb0c92e3b71a91114c897e3bae81f51d9ef
4
- data.tar.gz: e52d588661951e958e2d3551f2cfa92f622dacf9a84a00f50590db18d8fb0905
3
+ metadata.gz: cb2113329a8f68d1433d8d54846c73eb620818041f617f5140afd00247c53dec
4
+ data.tar.gz: ff64fce4f52a30f3d1289925f92ab30767d4e1ee54f75f96e702f32ae4e5354c
5
5
  SHA512:
6
- metadata.gz: 7320d62158d94eca1db5ba269fb1a38e2c611a9772104cf718c2aa602407ff1648bcd0daeea2581c32478121fff351cb08881b8b02d8f14e4be67cbe0e726f40
7
- data.tar.gz: a74ddef7f64bc99e3d87518ee97988dcf47f56a8d9cb3ef28bd6fed1e739ecf41ba94b4822eb1590f1bffda1badfbc5d28ec8433d9bf5e6ffaafab86274fde5d
6
+ metadata.gz: 784acf6fd048f8f521ebcb4dad4381b48db1e79a32b424d98c790b8abf74ddbf1f3a6b69ae2dffe67dd68a731dda295aa7df627689ba5672837d2be4fe0a0b0e
7
+ data.tar.gz: 4ead6219753043957a4728b8808b57a0829a4954671f06895002ffc47c1087e61124a9c1d37a7328fa203e0a1ad5541570247513f79b8b477518ba704bd4f44d
@@ -16,11 +16,7 @@ module IntelliAgent::OpenAI
16
16
 
17
17
  response = OpenAI::Client.new.chat(parameters:)
18
18
 
19
- if response_format.nil?
20
- response.dig('choices', 0, 'message', 'content').strip
21
- else
22
- response
23
- end
19
+ response.dig('choices', 0, 'message', 'content').strip
24
20
  end
25
21
 
26
22
  def self.vision(prompt:, image_url:, model: :advanced, response_format: nil, max_tokens: MAX_TOKENS)
@@ -32,12 +28,8 @@ module IntelliAgent::OpenAI
32
28
  parameters[:response_format] = { type: 'json_object' } if response_format.eql?(:json)
33
29
 
34
30
  response = OpenAI::Client.new.chat(parameters:)
35
-
36
- if response_format.nil?
37
- response.dig('choices', 0, 'message', 'content').strip
38
- else
39
- response
40
- end
31
+
32
+ response.dig('choices', 0, 'message', 'content').strip
41
33
  end
42
34
 
43
35
  def self.single_chat(system:, user:, model: :basic, response_format: nil, max_tokens: MAX_TOKENS)
@@ -51,11 +43,8 @@ module IntelliAgent::OpenAI
51
43
  parameters[:response_format] = { type: 'json_object' } if response_format.eql?(:json)
52
44
 
53
45
  response = OpenAI::Client.new.chat(parameters:)
54
- if response_format.nil?
55
- response.dig('choices', 0, 'message', 'content').strip
56
- else
57
- response
58
- end
46
+
47
+ response.dig('choices', 0, 'message', 'content').strip
59
48
  end
60
49
 
61
50
  def self.chat(messages:, model: :basic, response_format: nil, max_tokens: MAX_TOKENS)
@@ -67,11 +56,8 @@ module IntelliAgent::OpenAI
67
56
  parameters[:response_format] = { type: 'json_object' } if response_format.eql?(:json)
68
57
 
69
58
  response = OpenAI::Client.new.chat(parameters:)
70
- if response_format.nil?
71
- response.dig('choices', 0, 'message', 'content').strip
72
- else
73
- response
74
- end
59
+
60
+ response.dig('choices', 0, 'message', 'content').strip
75
61
  end
76
62
 
77
63
  def self.models = OpenAI::Client.new.models.list
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intelli_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gedean Dias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2027-09-01 00:00:00.000000000 Z
11
+ date: 2027-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-openai