deepl-rb 3.4.0 → 3.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +27 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00b711743a7d8a7e5851e6985f624376f669ecaff43a25437485f77b42970b1c
4
- data.tar.gz: b75a87f8ba086f6d8d7f67f5c7f955a95488722032d4d0c19547a1aa16b19156
3
+ metadata.gz: 5778d1b4102e5d798b157de8dcaeecd069d55f0f333eb190e510eb6b0593df9f
4
+ data.tar.gz: 117d03157edd90e2da5e6064f5d9c4b8c0ede6beddd009b7016b48d0e2673e19
5
5
  SHA512:
6
- metadata.gz: 8bd6e8200cae9ab13b19a20a30743e292074311f437e3c58658a176a4489f39667ca4d2dd056c36d0e76fade63b2832e3a8fb478bce348d6e746acb82ad07511
7
- data.tar.gz: aa9bfb1bc15e12dbe612e68796651b20d7aeeef021fac5d5feb391dc9a55f6c3b22e8257b9b228d6bd62d826833fdf7022c42fd1b97411bbf4695ea69f7acf08
6
+ metadata.gz: e0b437203711dabb1b30f20a04964d940f17b5e85e41559436ea46dea5a2e093600122c58b15b486e81062831bb12534a146820b8cca69fd262710b8757caab1
7
+ data.tar.gz: c581a473d282486dcd516eacb8a20996302806bf0a40cf4e34467e11ea0f4445660a938addd64f60be5e01b05e32e17d54e3fdea542c14f23ee6b203fd789391
data/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ## [3.6.0] - 2025-12-10
10
+ ### Added
11
+ - Added `tag_handling_version` parameter to `translate()` to specify which version of the tag handling algorithm to use. Options are `v1` and `v2`.
12
+
13
+ ## [3.5.0] - 2025-12-03
14
+ ### Added
15
+ - Added `custom_instructions` parameter to `translate()` to customize translation
16
+ behavior with up to 10 instructions (max 300 characters each). Only supported for
17
+ target languages: `de`, `en`, `es`, `fr`, `it`, `ja`, `ko`, `zh` and their variants.
18
+ Note: using the `custom_instructions` parameter will use the `quality_optimized`
19
+ model type as the default. Requests combining `custom_instructions` and the
20
+ `latency_optimized` model type will be rejected.
21
+
7
22
  ## [3.4.0] - 2025-11-17
8
23
  ### Added
9
24
  - Added support for the `GET /v3/style_rules` endpoint in the client library, the
@@ -71,6 +86,9 @@ The change in major version is only due to the change in maintainership, there i
71
86
  ### Fixed
72
87
  - Make RequestEntityTooLarge error message more clear
73
88
 
89
+ [Unreleased]: https://github.com/DeepLcom/deepl-rb/compare/v3.6.0...HEAD
90
+ [3.6.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.5.0...v3.6.0
91
+ [3.5.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.4.0...v3.5.0
74
92
  [3.4.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.3.0...v3.4.0
75
93
  [3.3.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.2.0...v3.3.0
76
94
  [3.2.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.1.0...v3.2.0
data/README.md CHANGED
@@ -127,6 +127,18 @@ puts translation.text
127
127
  # => "<p>Una muestra</p>"
128
128
  ```
129
129
 
130
+ To specify which version of the tag handling algorithm to use, you can use the `tag_handling_version` parameter:
131
+
132
+ ```rb
133
+ translation = DeepL.translate '<p>A sample</p>', 'EN', 'ES',
134
+ tag_handling: 'xml', tag_handling_version: 'v2'
135
+
136
+ puts translation.text
137
+ # => "<p>Una muestra</p>"
138
+ ```
139
+
140
+ The available values are `'v1'` and `'v2'`.
141
+
130
142
  To translate with context, simply supply the `context` parameter:
131
143
 
132
144
  ```rb
@@ -153,6 +165,19 @@ This would use next-gen translation models for the translation. The available va
153
165
  - `'latency_optimized'`: use a translation model that minimizes response time, at the cost
154
166
  of translation quality.
155
167
 
168
+ To translate with custom instructions, supply the `custom_instructions` parameter:
169
+
170
+ ```rb
171
+ translation = DeepL.translate 'Hello, world!', 'EN', 'DE',
172
+ custom_instructions: ['Use informal language', 'Be concise']
173
+
174
+ puts translation.text
175
+ ```
176
+
177
+ Up to 10 custom instructions can be specified, each with a maximum of 300 characters.
178
+ The target language must be `de`, `en`, `es`, `fr`, `it`, `ja`, `ko`, `zh` or any variants.
179
+ Note that using `custom_instructions` will automatically use `quality_optimized` models,
180
+ and cannot be combined with `model_type: 'latency_optimized'`.
156
181
 
157
182
  The following parameters will be automatically converted:
158
183
 
@@ -169,6 +194,8 @@ The following parameters will be automatically converted:
169
194
  | `style_id` | No conversion applied
170
195
  | `style_rule` | No conversion applied (can be a string ID or a StyleRule object)
171
196
  | `context` | No conversion applied
197
+ | `custom_instructions` | No conversion applied
198
+ | `tag_handling_version` | No conversion applied
172
199
  | `extra_body_parameters` | Hash of extra parameters to pass in the body of the HTTP request. Can be used to access beta features, or to override built-in parameters for testing purposes. Extra parameters can override keys explicitly set by the client.
173
200
 
174
201
  ### Rephrase Text
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deepl-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DeepL SE