lex-llm-gateway 0.2.4 → 0.2.5
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 44562169a54b0e789ff4656a30599b2c43314c59fd5b5bb3056bf790da5a7a01
|
|
4
|
+
data.tar.gz: 399266aaa074b1eeb0c69044987bf36d13a11668defcda7066133f5c25ed5a93
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d122cadcffddfa7fa848a2d5cd992682e40a2e9cf84e5868af845d90572a7965f9fd462e6f23bc1d275410f48332ce7111a4d823dbbf17de3d16583903f407c
|
|
7
|
+
data.tar.gz: a188786600832ed973a988da109d053a87e05b7cdea82ee08914f1cad7931d4db2f8f4f1f2ea37fe442f9382d731f4980e6a099c6e6db84af1bca10b49b95512
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.5] - 2026-03-23
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- FleetHandler multi-request-type dispatch: structured, embed, and multi-message chat
|
|
7
|
+
- `call_chat` supports single and multi-message payloads
|
|
8
|
+
- `call_structured` dispatches to `Legion::LLM.structured` with schema
|
|
9
|
+
- `call_embed` dispatches to `Legion::LLM.embed` with text fallback from messages
|
|
10
|
+
|
|
3
11
|
## [0.2.4] - 2026-03-23
|
|
4
12
|
|
|
5
13
|
### Added
|
|
@@ -35,12 +35,38 @@ module Legion
|
|
|
35
35
|
def call_local_llm(payload)
|
|
36
36
|
return { error: 'llm_not_available' } unless defined?(Legion::LLM)
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
case payload[:request_type]&.to_s
|
|
39
|
+
when 'structured'
|
|
40
|
+
call_structured(payload)
|
|
41
|
+
when 'embed'
|
|
42
|
+
call_embed(payload)
|
|
43
|
+
else
|
|
44
|
+
call_chat(payload)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def call_chat(payload)
|
|
49
|
+
messages = payload[:messages]
|
|
50
|
+
if messages.is_a?(Array) && messages.size > 1
|
|
51
|
+
Legion::LLM.chat(model: payload[:model], messages: messages)
|
|
52
|
+
else
|
|
53
|
+
Legion::LLM.chat(model: payload[:model], message: messages&.dig(0, :content))
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def call_structured(payload)
|
|
58
|
+
Legion::LLM.structured(
|
|
39
59
|
model: payload[:model],
|
|
40
|
-
|
|
60
|
+
messages: payload[:messages],
|
|
61
|
+
schema: payload[:schema]
|
|
41
62
|
)
|
|
42
63
|
end
|
|
43
64
|
|
|
65
|
+
def call_embed(payload)
|
|
66
|
+
text = payload[:text] || payload.dig(:messages, 0, :content)
|
|
67
|
+
Legion::LLM.embed(model: payload[:model], text: text)
|
|
68
|
+
end
|
|
69
|
+
|
|
44
70
|
def build_response(correlation_id, response)
|
|
45
71
|
{
|
|
46
72
|
correlation_id: correlation_id,
|