llm_conductor 1.7.0 → 1.7.1
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/examples/gemini_usage.rb +6 -9
- data/lib/llm_conductor/clients/gemini_client.rb +1 -1
- data/lib/llm_conductor/configuration.rb +5 -1
- data/lib/llm_conductor/version.rb +1 -1
- 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: 2a6fce29f76d891a6c773b998ec21a2cc30b1c34f979640f86a71d20bfc6af8d
|
|
4
|
+
data.tar.gz: 07ead7a9e05e819a6a644fc741ed5a118123d9130ea96d8725da6b4be09573ca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7cc94df2e2ed528d7fff9d688c9ac69cdad48282fc268da8aa78b8a0aa99db66bbffccd74661860b47f4df04a0f98826b60db27052eb55845282712bf514bfef
|
|
7
|
+
data.tar.gz: '032148a55e18c3402765695baa053f9fed3e07fcbb0dd7d550fa6199ba29a1ef1a63d7df644d6d839c502952614e6ae08585a24459345b7b34e96989fe60c350'
|
data/.rubocop.yml
CHANGED
data/examples/gemini_usage.rb
CHANGED
|
@@ -10,15 +10,13 @@
|
|
|
10
10
|
# Scenario B — Vertex AI with account-bound API key
|
|
11
11
|
# SCENARIO=vertex_api_key GEMINI_API_KEY=... GOOGLE_VERTEX_PROJECT_ID=... ruby examples/gemini_usage.rb
|
|
12
12
|
#
|
|
13
|
-
# Scenario C — Vertex AI via
|
|
13
|
+
# Scenario C — Vertex AI via service account file (GOOGLE_APPLICATION_CREDENTIALS)
|
|
14
14
|
# SCENARIO=adc \
|
|
15
|
-
# GOOGLE_VERTEX_PROJECT_ID=... \
|
|
16
15
|
# GOOGLE_APPLICATION_CREDENTIALS=/path/to/sa.json \
|
|
17
16
|
# ruby examples/gemini_usage.rb
|
|
18
17
|
#
|
|
19
|
-
# Scenario
|
|
18
|
+
# Scenario D — Vertex AI via credentials file contents
|
|
20
19
|
# SCENARIO=file_contents \
|
|
21
|
-
# GOOGLE_VERTEX_PROJECT_ID=... \
|
|
22
20
|
# GOOGLE_CREDENTIALS_FILE_CONTENTS=$(cat /path/to/sa.json) \
|
|
23
21
|
# ruby examples/gemini_usage.rb
|
|
24
22
|
|
|
@@ -30,8 +28,8 @@ PROMPT = 'Say hello.'
|
|
|
30
28
|
SCENARIOS = {
|
|
31
29
|
'api_key' => -> { ENV['GEMINI_API_KEY'] && !ENV['GOOGLE_VERTEX_PROJECT_ID'] },
|
|
32
30
|
'vertex_api_key' => -> { ENV['GEMINI_API_KEY'] && ENV['GOOGLE_VERTEX_PROJECT_ID'] },
|
|
33
|
-
'adc' => -> { ENV['
|
|
34
|
-
'file_contents' => -> { ENV['
|
|
31
|
+
'adc' => -> { ENV['GOOGLE_APPLICATION_CREDENTIALS'] },
|
|
32
|
+
'file_contents' => -> { ENV['GOOGLE_CREDENTIALS_FILE_CONTENTS'] }
|
|
35
33
|
}.freeze
|
|
36
34
|
|
|
37
35
|
def run_scenario(name)
|
|
@@ -50,15 +48,14 @@ def run_scenario(name)
|
|
|
50
48
|
|
|
51
49
|
when 'adc'
|
|
52
50
|
LlmConductor.configure do |c|
|
|
53
|
-
c.gemini(
|
|
51
|
+
c.gemini(file_path: ENV.fetch('GOOGLE_APPLICATION_CREDENTIALS'),
|
|
54
52
|
region: ENV['GOOGLE_VERTEX_REGION'])
|
|
55
53
|
end
|
|
56
54
|
label = 'vertex_ai/adc'
|
|
57
55
|
|
|
58
56
|
when 'file_contents'
|
|
59
57
|
LlmConductor.configure do |c|
|
|
60
|
-
c.gemini(
|
|
61
|
-
region: ENV['GOOGLE_VERTEX_REGION'],
|
|
58
|
+
c.gemini(region: ENV['GOOGLE_VERTEX_REGION'],
|
|
62
59
|
file_contents: ENV.fetch('GOOGLE_CREDENTIALS_FILE_CONTENTS'))
|
|
63
60
|
end
|
|
64
61
|
label = 'vertex_ai/file_contents'
|
|
@@ -167,7 +167,7 @@ module LlmConductor
|
|
|
167
167
|
if config[:project_id] && config[:api_key]
|
|
168
168
|
{ service: 'vertex-ai-api', region: config[:region], project_id: config[:project_id],
|
|
169
169
|
api_key: config[:api_key] }
|
|
170
|
-
elsif config[:project_id]
|
|
170
|
+
elsif config[:project_id] || config[:file_path] || config[:file_contents]
|
|
171
171
|
vertex_ai_credentials(config)
|
|
172
172
|
else
|
|
173
173
|
{ service: 'generative-language-api', api_key: config[:api_key] }
|
|
@@ -167,12 +167,16 @@ module LlmConductor
|
|
|
167
167
|
end
|
|
168
168
|
|
|
169
169
|
def setup_gemini_from_env
|
|
170
|
-
return unless ENV.values_at(
|
|
170
|
+
return unless ENV.values_at(
|
|
171
|
+
'GEMINI_API_KEY', 'GOOGLE_VERTEX_PROJECT_ID',
|
|
172
|
+
'GOOGLE_APPLICATION_CREDENTIALS', 'GOOGLE_CREDENTIALS_FILE_CONTENTS'
|
|
173
|
+
).any?
|
|
171
174
|
|
|
172
175
|
gemini(
|
|
173
176
|
api_key: ENV['GEMINI_API_KEY'],
|
|
174
177
|
project_id: ENV['GOOGLE_VERTEX_PROJECT_ID'],
|
|
175
178
|
region: ENV['GOOGLE_VERTEX_REGION'],
|
|
179
|
+
file_path: ENV['GOOGLE_APPLICATION_CREDENTIALS'],
|
|
176
180
|
file_contents: ENV['GOOGLE_CREDENTIALS_FILE_CONTENTS']
|
|
177
181
|
)
|
|
178
182
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: llm_conductor
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.7.
|
|
4
|
+
version: 1.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Zheng
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-05-
|
|
10
|
+
date: 2026-05-16 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: activesupport
|