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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/llm_meta_client/server_query.rb +8 -4
- data/lib/llm_meta_client/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: a1afc833ffdebd20e85c17d3d86ba6f89d8da0ac893bf0e19e33b0071e5be7de
|
|
4
|
+
data.tar.gz: be3d6e7dd8809c5b084e9c5cc714d6a5bf969dc70ae097a4d79cea079e63f7a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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),
|