intelli_agent 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/intelli_agent/openai.rb +7 -21
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb2113329a8f68d1433d8d54846c73eb620818041f617f5140afd00247c53dec
|
4
|
+
data.tar.gz: ff64fce4f52a30f3d1289925f92ab30767d4e1ee54f75f96e702f32ae4e5354c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 784acf6fd048f8f521ebcb4dad4381b48db1e79a32b424d98c790b8abf74ddbf1f3a6b69ae2dffe67dd68a731dda295aa7df627689ba5672837d2be4fe0a0b0e
|
7
|
+
data.tar.gz: 4ead6219753043957a4728b8808b57a0829a4954671f06895002ffc47c1087e61124a9c1d37a7328fa203e0a1ad5541570247513f79b8b477518ba704bd4f44d
|
data/lib/intelli_agent/openai.rb
CHANGED
@@ -16,11 +16,7 @@ module IntelliAgent::OpenAI
|
|
16
16
|
|
17
17
|
response = OpenAI::Client.new.chat(parameters:)
|
18
18
|
|
19
|
-
|
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
|
-
|
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
|
-
|
55
|
-
|
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
|
-
|
71
|
-
|
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.
|
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-
|
11
|
+
date: 2027-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-openai
|