omniai-google 1.8.3 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniai/google/chat.rb +15 -2
- data/lib/omniai/google/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18c29d5c7580f38ae07eb596186fea540ccd1e179dccd906b3fb1473c187546c
|
4
|
+
data.tar.gz: 187dc0cffd36841469b5fd998216f3f3fa2a56b1cce7bd7d51c9ececa12784e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ddd16af090b9692ff68f7d816e7d153759dd65793d7b816ae40e5ce195c0341f4c6959df4a1bfc09a9452df07bd6fe9633ccc7b46a89e2513c3a417c9f12ad0
|
7
|
+
data.tar.gz: 48c1d3a78de86387e9a95716ece83d27cb4c128bacc43285ed3830d210f2769516bfd69e9212f66caaf0e38dfe77ddcabd67d0005b4d21eeed41094de60e1590
|
data/lib/omniai/google/chat.rb
CHANGED
@@ -25,6 +25,8 @@ module OmniAI
|
|
25
25
|
|
26
26
|
DEFAULT_MODEL = Model::GEMINI_PRO
|
27
27
|
|
28
|
+
JSON_MIME_TYPE = 'application/json'
|
29
|
+
|
28
30
|
# @return [Context]
|
29
31
|
CONTEXT = Context.build do |context|
|
30
32
|
context.serializers[:text] = TextSerializer.method(:serialize)
|
@@ -98,9 +100,20 @@ module OmniAI
|
|
98
100
|
|
99
101
|
# @return [Hash]
|
100
102
|
def generation_config
|
101
|
-
|
103
|
+
response_mime_type = (JSON_MIME_TYPE if json_mime_type?)
|
104
|
+
|
105
|
+
return unless @temperature || response_mime_type
|
106
|
+
|
107
|
+
{
|
108
|
+
temperature: @temperature,
|
109
|
+
responseMimeType: response_mime_type,
|
110
|
+
}.compact
|
111
|
+
end
|
102
112
|
|
103
|
-
|
113
|
+
# Checks if setting a jsonMimeType is supported
|
114
|
+
# @return [Boolean]
|
115
|
+
def json_mime_type?
|
116
|
+
@client.version == OmniAI::Google::Config::Version::BETA && @format.eql?(:json)
|
104
117
|
end
|
105
118
|
|
106
119
|
# @return [String]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniai-google
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Sylvestre
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: event_stream_parser
|
@@ -92,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 3.
|
95
|
+
version: 3.2.0
|
96
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
97
|
requirements:
|
98
98
|
- - ">="
|