ask-llm-providers 0.13.4 → 0.13.6

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: a1561002d3a643aa61fa750f7074a1a362d45a108f9ea3c44b8d21f0704e6907
4
- data.tar.gz: d4702a9c31b9a3dda3bea771bd5722a31ccfa5443ebcd4b64a235cafad319d96
3
+ metadata.gz: 50fa40af50459e52a10bb0709fbf9f2f948cf351025d5971d89f434f3b59af0a
4
+ data.tar.gz: 119a652e9404ccca613b3e81721cbc23d3c87347bd79e55ceae6f7107e1320de
5
5
  SHA512:
6
- metadata.gz: 2e8c1f0e2f652dbd7031a27278f6e6ead1b23de697450ed14aa0882d2225c0d7392c9de0657504507740199112289ba70adc0ebb33b23427ffb4bc0b3106ef94
7
- data.tar.gz: 0154ff38051805e13c36fa9c7408ac7fbf5bb38d16362ebe215a9e3e39385b24db822afd2c872cb2a41424993ce4546fc00bf547af927936a2023d6381ab6ef6
6
+ metadata.gz: 700fc99441598c8103d64cce0aeb4cdc476564c69c79fd921c1a091ce9f72eea9ba77088185eed3cde8e5083b796d4fa780767d88be2c5270db14644998fda77
7
+ data.tar.gz: e0e42bfeb0f2aaa73b344f7f3041ea37dbaa3b3f10f44c66becd51caf5d7050d55b7abdf8dfcdf6467b0598d4f347eeda8c1cf15fa84c428f601a77bdf97babf
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [0.13.6] — 2026-09-13
2
+
3
+ ### Fixed
4
+
5
+ - **`deepseek/deepseek-v4.1-flash` is multimodal.** The catalog entry declared
6
+ text-only, so agents refused to send it images; it now carries image input
7
+ and the vision capability (native visual understanding since the Sept 10
8
+ release).
9
+
10
+ - **Empty user continuations are dropped from OpenAI-compatible requests.** After tool calls the agent loop appends an empty user message to prompt the next turn; strict gateways (Command Code) reject it with "user message must have content", breaking every tool-using turn. The provider now omits contentless user messages, which carry no information.
11
+
1
12
  ## [0.13.1] — 2026-09-05
2
13
 
3
14
  ### Fixed
@@ -5083,11 +5083,13 @@
5083
5083
  "context_window": 1000000,
5084
5084
  "capabilities": [
5085
5085
  "function_calling",
5086
- "streaming"
5086
+ "streaming",
5087
+ "vision"
5087
5088
  ],
5088
5089
  "modalities": {
5089
5090
  "input": [
5090
- "text"
5091
+ "text",
5092
+ "image"
5091
5093
  ],
5092
5094
  "output": [
5093
5095
  "text"
@@ -14454,4 +14456,4 @@
14454
14456
  "pricing": {},
14455
14457
  "created_at": "2026-01-28"
14456
14458
  }
14457
- ]
14459
+ ]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module LLM
5
- VERSION = "0.13.4"
5
+ VERSION = "0.13.6"
6
6
  end
7
7
  end
@@ -425,9 +425,27 @@ module Ask
425
425
  LLM::HTTP.connection(api_base, headers:, request: { open_timeout: 30, timeout: 600 })
426
426
  end
427
427
 
428
+ # Messages for the wire, minus the agent loop's empty user
429
+ # continuations: after tool calls the loop appends a "" user message
430
+ # to prompt the next turn, which strict OpenAI-compatible gateways
431
+ # reject ("user message must have content"). The message carries no
432
+ # information, so it is dropped here.
428
433
  def format_messages(messages)
429
- messages.map { |msg| format_message(msg) }
434
+ messages.filter_map do |msg|
435
+ next if empty_user_message?(msg)
436
+
437
+ format_message(msg)
438
+ end
439
+ end
440
+
441
+ def empty_user_message?(message)
442
+ role = message.respond_to?(:role) ? message.role : (message[:role] || message["role"])
443
+ return false unless role.to_s == "user"
444
+
445
+ content = message.respond_to?(:content) ? message.content : (message[:content] || message["content"])
446
+ content.to_s.strip.empty?
430
447
  end
448
+ private :empty_user_message?
431
449
 
432
450
  # Transform a generic content block hash into OpenAI's wire format.
433
451
  # https://platform.openai.com/docs/guides/vision
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-llm-providers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.4
4
+ version: 0.13.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.11.3
18
+ version: 0.11.4
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: 0.11.3
25
+ version: 0.11.4
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: ask-auth
28
28
  requirement: !ruby/object:Gem::Requirement