llm_meta_client 1.5.0 → 1.6.0

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: 392fd4f6a93475e739beef49bf50b8158fced469993b78875a22845777bcf96b
4
- data.tar.gz: '090a33919e5ac2916b1d5af16b11e9e831f954c00dc1a61f1459db931f3f02f8'
3
+ metadata.gz: a1afc833ffdebd20e85c17d3d86ba6f89d8da0ac893bf0e19e33b0071e5be7de
4
+ data.tar.gz: be3d6e7dd8809c5b084e9c5cc714d6a5bf969dc70ae097a4d79cea079e63f7a8
5
5
  SHA512:
6
- metadata.gz: 8e9546f73d0e30b8ebc5074fdbb5a244f0e657d82094e7ba64383d9aad07c69cfc2570cb6c0c7ec316f4314ab0c693a7260cf25e79301e2d1a633d93e47a97fb
7
- data.tar.gz: 2f84dd1aa7c422081d30a7c02b963eeae90c4e3b43e0b957f575e8cd348a773189f1137bb979f6922420404f7e7d3acbf70abe5403eabaa736e4a3cd14feb5be
6
+ metadata.gz: 8844927644808f81a7eabda2d5d19e7b65674545ed8d65fa3d336b6b7b4261b90e1c5f160eccdd439fd52507b32793305419104382746b9ea6a137d6d01e48eb
7
+ data.tar.gz: 1ae00410b164fc95a0c9cc06dc59fa4e0730331f95d1c787792ca9dbd8db829bd1d8f0db5d2f1f23c5c2c6dfee89f55d8dce93d200746b8963795c7a1cd377c6
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.6.0] - 2026-07-02
9
+
10
+ ### Added
11
+
12
+ - `ServerQuery#stream` and `#call` accept a new `document:` kwarg — a single-attachment PDF (`{mime:, data_b64:}`) that gets forwarded to `llm_meta_server` as `document` in the JSON body. Server-side enforces MIME (`application/pdf`) and a 10 MB cap; the client just relays the payload.
13
+
8
14
  ## [1.5.0] - 2026-06-04
9
15
 
10
16
  ### Added
@@ -12,7 +12,7 @@ module LlmMetaClient
12
12
  # Returns the final assistant content. If tool calls fired, the returned
13
13
  # string mirrors the synchronous #call format (response + markdown
14
14
  # "Tool calls" section appended) so persistence stays consistent.
15
- def stream(id_token, api_key_uuid, model_id, context, user_content, tool_ids: [], generation_settings: {}, image_context: nil, image: nil, images: nil)
15
+ def stream(id_token, api_key_uuid, model_id, context, user_content, tool_ids: [], generation_settings: {}, image_context: nil, image: nil, images: nil, document: nil)
16
16
  if image_context.present?
17
17
  prompt_text = user_content.is_a?(Hash) ? (user_content[:prompt] || user_content["prompt"]).to_s : user_content.to_s
18
18
  debug_log "Streaming image request to LLM: \n===>\n#{prompt_text}\n(with #{image_context.size} prior turn(s))\n===>"
@@ -31,6 +31,9 @@ module LlmMetaClient
31
31
  elsif image.present?
32
32
  body[:image] = image
33
33
  end
34
+ # document: single-attachment PDF for the current turn. Server enforces
35
+ # MIME (application/pdf) and a 10 MB cap; we just forward the payload.
36
+ body[:document] = document if document.present?
34
37
 
35
38
  assembled = +""
36
39
  collected_tool_calls = []
@@ -59,12 +62,12 @@ module LlmMetaClient
59
62
  collected_tool_calls.any? ? combine_with_tool_calls(assembled, collected_tool_calls) : assembled
60
63
  end
61
64
 
62
- def call(id_token, api_key_uuid, model_id, context, user_content, tool_ids: [], generation_settings: {})
65
+ def call(id_token, api_key_uuid, model_id, context, user_content, tool_ids: [], generation_settings: {}, document: nil)
63
66
  debug_log "Context: #{context}"
64
67
  context_and_user_content = "Context:#{context}, User Prompt: #{user_content}"
65
68
  debug_log "Request to LLM: \n===>\n#{context_and_user_content}\n===>"
66
69
 
67
- response = request(api_key_uuid, id_token, model_id, context_and_user_content, tool_ids, generation_settings)
70
+ response = request(api_key_uuid, id_token, model_id, context_and_user_content, tool_ids, generation_settings, document: document)
68
71
 
69
72
  unless response.success?
70
73
  raise Exceptions::ServerError, build_error_message(response.code.to_i, response.parsed_response)
@@ -113,13 +116,14 @@ module LlmMetaClient
113
116
  lines.join("\n")
114
117
  end
115
118
 
116
- def request(api_key_uuid, id_token, model_id, user_content, tool_ids, generation_settings)
119
+ def request(api_key_uuid, id_token, model_id, user_content, tool_ids, generation_settings, document: nil)
117
120
  headers = { "Content-Type" => "application/json" }
118
121
  headers["Authorization"] = "Bearer #{id_token}" if id_token.present?
119
122
 
120
123
  body = { prompt: user_content.to_s }
121
124
  body[:tool_ids] = tool_ids if tool_ids.present?
122
125
  body[:generation_settings] = generation_settings if generation_settings.present?
126
+ body[:document] = document if document.present?
123
127
 
124
128
  HTTParty.post(
125
129
  url(api_key_uuid, model_id),
@@ -1,3 +1,3 @@
1
1
  module LlmMetaClient
2
- VERSION = "1.5.0"
2
+ VERSION = "1.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llm_meta_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dhq_boiler