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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +2 -0
- data/lib/ruby_llm/providers/infomaniak/media.rb +5 -0
- data/lib/ruby_llm/providers/infomaniak/version.rb +1 -1
- data/lib/ruby_llm/providers/infomaniak.rb +5 -2
- 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: 313aafbac43b95af0726c18ae23550a1d5af92ce8f2fd37df2d278a10e9ac38f
|
|
4
|
+
data.tar.gz: 1176ac3099d709cab842735916ee51de3276e1fb2e27ac8a4bb86309add7b2db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
[](https://rubygems.org/gems/ruby_llm-providers-infomaniak)
|
|
4
4
|
[](https://github.com/Largo/ruby_llm-providers-infomaniak/actions/workflows/tests.yml)
|
|
5
5
|
|
|
6
|
+

|
|
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
|
|
@@ -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
|
-
|
|
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
|