ruby_llm-providers-infomaniak 0.2.0 → 0.2.1

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: 8a7d8b0d086efaa9c17802b1a0fad9b129627e42014334458219956e553ea49d
4
- data.tar.gz: 874abaf93d029ac7c471d9c0c1a7a7c1f78ff603159b67b60bf91f213111a321
3
+ metadata.gz: 313aafbac43b95af0726c18ae23550a1d5af92ce8f2fd37df2d278a10e9ac38f
4
+ data.tar.gz: 1176ac3099d709cab842735916ee51de3276e1fb2e27ac8a4bb86309add7b2db
5
5
  SHA512:
6
- metadata.gz: 991cb79aae76ef6e1b7a8df3b78468c855d7f9f6b7bcaeaf3c86a8d386f529794b95beacb15320162f492df8df997b78d83a13390b5d51a90fde9c6d7a2c002e
7
- data.tar.gz: d70228140d4b2b2eb504f71d2637817355dc18ccee36f9a6eb4d1da736c7788cf7d03e27ce8ad529c4f4c00247bf97263c2637fd277d676575237a9f1d5e7f53
6
+ metadata.gz: dc6651ace176ee4dcdfb2966a3935c316d0b9b3ab61b8a3b4e0e015a1b29455a510522a3ee375fa5da1aa72d4640d2c1e8414e94661cd6eb1d023fbea8dba421
7
+ data.tar.gz: 8d9527b0e60fbb7462fa10bb2375305cac960599d4394cb72c7ecc0c52a024b220450c020fb96efe0406e883b6fa42014a9328369ebcb4e9a5aeb3938415ede0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1
4
+
5
+ - `RubyLLM.paint` without `size:` works: the size is left out instead of being sent as null,
6
+ which Infomaniak rejected.
7
+ - Error messages include Infomaniak's validation details, e.g.
8
+ "Validation failed: The size field must have a value. (validation_failed)".
9
+
3
10
  ## 0.2.0
4
11
 
5
12
  - Reranking (`RubyLLM.rerank`) with `BAAI/bge-reranker-v2-m3` and `Qwen/Qwen3-Reranker-0.6B`, on the
data/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/ruby_llm-providers-infomaniak.svg)](https://rubygems.org/gems/ruby_llm-providers-infomaniak)
4
4
  [![tests](https://github.com/Largo/ruby_llm-providers-infomaniak/actions/workflows/tests.yml/badge.svg)](https://github.com/Largo/ruby_llm-providers-infomaniak/actions/workflows/tests.yml)
5
5
 
6
+ ![ruby_llm-providers-infomaniak: Swiss-hosted open models, in plain Ruby](docs/social/twitter-card.png)
7
+
6
8
  **Open-weight models hosted in Switzerland, through the RubyLLM API you already know.**
7
9
 
8
10
  This gem adds [Infomaniak AI Tools](https://www.infomaniak.com/en/hosting/ai-tools) as a provider to
@@ -19,6 +19,11 @@ module RubyLLM
19
19
  @provider.product_url(1, 'openai/images/generations')
20
20
  end
21
21
 
22
+ # Infomaniak rejects "size": null, so a paint call without size: leaves it out.
23
+ def render_image_payload(prompt, model:, size:, **)
24
+ super.compact
25
+ end
26
+
22
27
  def validate_paint_inputs!(with:, mask:)
23
28
  raise ArgumentError, 'Infomaniak generates images from a prompt only; it cannot edit images' if editing?(with, mask)
24
29
  end
@@ -3,7 +3,7 @@
3
3
  module RubyLLM
4
4
  module Providers
5
5
  class Infomaniak < Provider
6
- VERSION = '0.2.0'
6
+ VERSION = '0.2.1'
7
7
  end
8
8
  end
9
9
  end
@@ -65,13 +65,16 @@ module RubyLLM
65
65
  @account_connection ||= Transport::Connection.new(self, @config, api_base: API_HOST)
66
66
  end
67
67
 
68
- # Infomaniak's own endpoints answer {"result":"error","error":{"code":..,"description":..}}.
68
+ # Infomaniak's own endpoints answer {"result":"error","error":{"code":..,"description":..}},
69
+ # with the specifics of a validation failure in error.errors[].description.
69
70
  def parse_error(response)
70
71
  body = parse_error_body(response)
71
72
  error = body['error'] if body.is_a?(Hash)
72
73
  return super unless error.is_a?(Hash) && error['description']
73
74
 
74
- [error['description'], error['code']].compact.uniq.join(' - ')
75
+ details = Array(error['errors']).filter_map { |item| item['description'] if item.is_a?(Hash) }
76
+ message = details.any? ? "#{error['description']}: #{details.join(' ')}" : error['description']
77
+ error['code'] ? "#{message} (#{error['code']})" : message
75
78
  end
76
79
 
77
80
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_llm-providers-infomaniak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andi Idogawa