legion-llm 0.5.23 → 0.5.24

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: 9bfeb8ca0bacd82ef217f76275e20d8df7a15f83a324bcf9f090232ed7374837
4
- data.tar.gz: cb4ceb07ae6004670a9e582a1fad6d3d2bc9a87e5a123116ff1ef995e5576744
3
+ metadata.gz: 7faa875219df27f00724444b192db231e6ef9f0b9a56da041791fbec1a17abb0
4
+ data.tar.gz: 271946a65933ed5366a9240490f4ba2df08f9a5c70200ab3b2605d413f6da611
5
5
  SHA512:
6
- metadata.gz: 0a24a288be1a94ef846aea5c47871c7f7875e99749078a77a431af854fbdbf3582cfdf1191aa570d9ae08d77f723bb653fa4b431258c77f5e050e2bd8ec367ef
7
- data.tar.gz: '0508aced0a6e1e8f09fb2e6ae2c8121f81d2b8efe765e37b1bb7d23c5ae688dcb9dc314c0a92cb6caef004c0ee8767f3b79e961728d3f278a5ceaf99bd16d844'
6
+ metadata.gz: 5b75a996f84fa52a56e2dd145ae411007e7b0e82ebbf4c3ebf472d3368c8fb9647c311de67eb3500861c2758ba2c62ae7d90c7f8540c2080625ee99ba40d21c2
7
+ data.tar.gz: d390c9821b76cca8889c46a5f1999408de60dadb5d0c6db05c3fa7b0e68faa152bd557b9e19e38897b5ff52af8a05be26f74f0dc32a10ea09a282247a62f0c60
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.5.24] - 2026-03-31
6
+
7
+ ### Added
8
+ - `DaemonClient.inference` accepts optional `caller:` and `conversation_id:` kwargs, forwarded in POST body
9
+ - `/api/llm/inference` route accepts `caller` and `conversation_id` from POST body, forwards to `Legion::LLM.chat`
10
+
5
11
  ## [0.5.23] - 2026-03-31
6
12
 
7
13
  ### Added
@@ -105,10 +105,13 @@ module Legion
105
105
  # POSTs a conversation-level inference request to the daemon REST API.
106
106
  # Accepts a full messages array and optional tool schemas.
107
107
  # Returns a status hash with structured inference fields on success.
108
- def inference(messages:, tools: [], model: nil, provider: nil, timeout: 120)
108
+ def inference(messages:, tools: [], model: nil, provider: nil, caller: nil, conversation_id: nil,
109
+ timeout: 120)
109
110
  body = { messages: messages, tools: tools }
110
- body[:model] = model if model
111
- body[:provider] = provider if provider
111
+ body[:model] = model if model
112
+ body[:provider] = provider if provider
113
+ body[:caller] = caller if caller
114
+ body[:conversation_id] = conversation_id if conversation_id
112
115
 
113
116
  response = http_post('/api/llm/inference', body, timeout: timeout)
114
117
  interpret_inference_response(response)
@@ -289,10 +289,12 @@ module Legion
289
289
  body = parse_request_body
290
290
  validate_required!(body, :messages)
291
291
 
292
- messages = body[:messages]
293
- raw_tools = body[:tools]
294
- model = body[:model]
295
- provider = body[:provider]
292
+ messages = body[:messages]
293
+ raw_tools = body[:tools]
294
+ model = body[:model]
295
+ provider = body[:provider]
296
+ caller_context = body[:caller]
297
+ conversation_id = body[:conversation_id]
296
298
 
297
299
  unless messages.is_a?(Array)
298
300
  halt 400, { 'Content-Type' => 'application/json' },
@@ -331,13 +333,17 @@ module Legion
331
333
  { role: ms[:role].to_s, content: ms[:content].to_s }
332
334
  end
333
335
 
334
- result = Legion::LLM.chat(
336
+ effective_caller = caller_context || { source: 'api', path: request.path }
337
+ chat_opts = {
335
338
  messages: normalized_messages,
336
339
  model: model,
337
340
  provider: provider,
338
341
  tools: tool_declarations,
339
- caller: { source: 'api', path: request.path }
340
- )
342
+ caller: effective_caller
343
+ }
344
+ chat_opts[:conversation_id] = conversation_id if conversation_id
345
+
346
+ result = Legion::LLM.chat(**chat_opts)
341
347
 
342
348
  if result.is_a?(Legion::LLM::Pipeline::Response)
343
349
  raw_msg = result.message
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module LLM
5
- VERSION = '0.5.23'
5
+ VERSION = '0.5.24'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-llm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.23
4
+ version: 0.5.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity