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: 708b97f62b7c6e7f238c29515948c677ed02adf7b0c0c7d3c0ba815968a07b2a
4
- data.tar.gz: 02fdff0ee5e874ae0d5a4054c923e751f44491d4299e8a5a686fed18e7e4f701
3
+ metadata.gz: 44562169a54b0e789ff4656a30599b2c43314c59fd5b5bb3056bf790da5a7a01
4
+ data.tar.gz: 399266aaa074b1eeb0c69044987bf36d13a11668defcda7066133f5c25ed5a93
5
5
  SHA512:
6
- metadata.gz: ab1de24d90fda54114752b2983f7cbd2822bf83703dc3a50d7075025389b396cd8bbb1c6beca861e101f3a5ad9b3eb02bb12baa3426c618e81c3fe31c02bd1e3
7
- data.tar.gz: 0cec3bd7a834241ef4426ea5bb7347362170f708d533ebe02472adbd0e23a7d5293fe21bab00ace05e03731be26660e2879827625eeb92d4b4b6cef002a577eb
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
- Legion::LLM.chat(
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
- message: payload.dig(:messages, 0, :content)
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,
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module LLM
6
6
  module Gateway
7
- VERSION = '0.2.4'
7
+ VERSION = '0.2.5'
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-llm-gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity