legion-llm 0.6.0 → 0.6.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/CHANGELOG.md +7 -0
- data/lib/legion/llm/pipeline/steps/gaia_advisory.rb +48 -0
- data/lib/legion/llm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bca23ecab222b8337fa88d7b2c62558334a547f24a86eb5cfb2a91e19cdddaaa
|
|
4
|
+
data.tar.gz: e6ef75f61a86d8a6e6bb1ed73a775180d2a70e3c5e42dbacb66ca43762b95dac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e5d23bc887ceffee4e66212c45b83211deb7ad7d2da73fe199701ca894175cafe6245db62d4a330e2f2c3642e2b33d8d9e7d1751c8ff43294c473cefd876f18
|
|
7
|
+
data.tar.gz: ed094dfd2c7ff7771a9d8eeb0ecd05114ebe49cf79e402e5c69cf4f573746b0c53d51ad7fe5ba47cbd18fe3a9fe8d91b059cd73f399b3d082a1123dac3414485
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.6.1] - 2026-03-31
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Advisory step reads calibration_weights from Apollo Local, includes in advisory enrichment
|
|
9
|
+
- Advisory meta recording: classifies advisory types and calls `Legion::Gaia.record_advisory_meta`
|
|
10
|
+
- Advisory type classification based on partner context (tone, verbosity, format, context, hint)
|
|
11
|
+
|
|
5
12
|
## [0.6.0] - 2026-03-31
|
|
6
13
|
|
|
7
14
|
### Added
|
|
@@ -21,6 +21,9 @@ module Legion
|
|
|
21
21
|
|
|
22
22
|
enrich_advisory_with_partner_context(advisory)
|
|
23
23
|
|
|
24
|
+
calibration_weights = fetch_calibration_weights
|
|
25
|
+
advisory[:calibration_weights] = calibration_weights if calibration_weights
|
|
26
|
+
|
|
24
27
|
@enrichments['gaia:advisory'] = {
|
|
25
28
|
content: advisory_summary(advisory),
|
|
26
29
|
data: advisory,
|
|
@@ -46,6 +49,8 @@ module Legion
|
|
|
46
49
|
direction: :inbound, detail: advisory_summary(advisory),
|
|
47
50
|
from: 'gaia', to: 'pipeline'
|
|
48
51
|
)
|
|
52
|
+
|
|
53
|
+
record_advisory_meta_to_gaia(advisory)
|
|
49
54
|
rescue StandardError => e
|
|
50
55
|
@warnings << "GAIA advisory error: #{e.message}"
|
|
51
56
|
end
|
|
@@ -160,6 +165,49 @@ module Legion
|
|
|
160
165
|
:infrequent
|
|
161
166
|
end
|
|
162
167
|
end
|
|
168
|
+
|
|
169
|
+
def fetch_calibration_weights
|
|
170
|
+
return nil unless apollo_local_available?
|
|
171
|
+
|
|
172
|
+
result = ::Legion::Apollo::Local.query(
|
|
173
|
+
text: 'bond calibration weights',
|
|
174
|
+
tags: %w[bond calibration weights]
|
|
175
|
+
)
|
|
176
|
+
return nil unless result[:success] && result[:results]&.any?
|
|
177
|
+
|
|
178
|
+
raw = ::JSON.parse(result[:results].first[:content])
|
|
179
|
+
raw['weights']
|
|
180
|
+
rescue StandardError
|
|
181
|
+
nil
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
def record_advisory_meta_to_gaia(advisory)
|
|
185
|
+
return unless defined?(::Legion::Gaia) && ::Legion::Gaia.respond_to?(:record_advisory_meta)
|
|
186
|
+
return unless advisory[:partner_context]
|
|
187
|
+
|
|
188
|
+
advisory_id = SecureRandom.uuid
|
|
189
|
+
advisory_types = classify_advisory_types(advisory)
|
|
190
|
+
|
|
191
|
+
::Legion::Gaia.record_advisory_meta(
|
|
192
|
+
advisory_id: advisory_id,
|
|
193
|
+
advisory_types: advisory_types
|
|
194
|
+
)
|
|
195
|
+
rescue StandardError
|
|
196
|
+
nil
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
def classify_advisory_types(advisory)
|
|
200
|
+
types = []
|
|
201
|
+
pc = advisory[:partner_context]
|
|
202
|
+
return ['partner_hint'] unless pc
|
|
203
|
+
|
|
204
|
+
types << 'partner_hint' if pc
|
|
205
|
+
types << 'context_injection' if advisory[:context_window]
|
|
206
|
+
types << 'tone_adjustment' if pc[:recent_sentiment] && pc[:recent_sentiment] != :neutral
|
|
207
|
+
types << 'verbosity_adjustment' if pc[:interaction_pattern] && pc[:interaction_pattern] != :unknown
|
|
208
|
+
types << 'format_adjustment' if pc[:compatibility]
|
|
209
|
+
types.empty? ? ['partner_hint'] : types
|
|
210
|
+
end
|
|
163
211
|
end
|
|
164
212
|
end
|
|
165
213
|
end
|
data/lib/legion/llm/version.rb
CHANGED