immosquare-translate 0.1.8 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1faeaa90371b731d6a14a8cfac0fa67f335278dd94c0a18b539cfcf622ca9c01
4
- data.tar.gz: 530d4bcd43664a2adb51f909f913901da2350d68dae366dbbdb0bf423870b7f9
3
+ metadata.gz: 46609ea19a96314d69cfcb8e0ef8083700213bf23a8ad6520558e7fd438bd4df
4
+ data.tar.gz: cfd0087b85c20c4623564cef8957a07412b63292623958189f64adb112b6e3d1
5
5
  SHA512:
6
- metadata.gz: c90ef3262e2ae2d1ef258fc98c1de0e8870cda69f78cf818c17534e7aa580a35f18522d5f18961581ec419092bc3846118b1ddd703f50a95eb1ebb6af7e36107
7
- data.tar.gz: 2f112af6ddde271c8ea31abbbb9b148a82346871a5c9fe54c51522dd4e555f9e7723f931fa15dff73851520fdeec8f277a0f2387983deef3389db6dc2d860f69
6
+ metadata.gz: 40f41ae2c313b8f9e90a61b5214d68c6a4c9f2e9bb8fe503bc061384d8306bf4871b5ee27e394ebc9bd51093591f715567a181350ba13bc697d24f81789455a8
7
+ data.tar.gz: fcab83bb1f6fdf680113cbaabd8e803062bd700002bf9f19f2043151b580719943314cfe0a384091f3ca4a2d314cda104148d3c754aac47d45c24b52b6588848
@@ -7,8 +7,9 @@ module ImmosquareTranslate
7
7
 
8
8
 
9
9
  OPEN_AI_MODELS = [
10
- {:name => "gpt-3.5-turbo-0125", :window_tokens => 16_385, :output_tokens => 4096, :input_price_for_1m => 0.50, :output_price_for_1m => 1.50, :group_size => 75},
11
- {:name => "gpt-4-0125-preview", :window_tokens => 128_000, :output_tokens => 4096, :input_price_for_1m => 10.00, :output_price_for_1m => 30.00, :group_size => 75}
10
+ {:name => "gpt-3.5-turbo-0125", :window_tokens => 16_385, :output_tokens => 4096, :input_price_for_1m => 0.50, :output_price_for_1m => 1.50, :group_size => 75},
11
+ {:name => "gpt-4-turbo", :window_tokens => 128_000, :output_tokens => 4096, :input_price_for_1m => 10.00, :output_price_for_1m => 30.00, :group_size => 75}
12
+ {:name => "gpt-4o", :window_tokens => 128_000, :output_tokens => 4096, :input_price_for_1m => 5.00, :output_price_for_1m => 15.00, :group_size => 75}
12
13
  ].freeze
13
14
  end
14
15
  end
@@ -18,7 +18,7 @@ module ImmosquareTranslate
18
18
 
19
19
  model_name = ImmosquareYaml.configuration.openai_model
20
20
  model = OPEN_AI_MODELS.find {|m| m[:name] == model_name }
21
- model = OPEN_AI_MODELS.find {|m| m[:name] == "gpt-4-0125-preview" } if model.nil?
21
+ model = OPEN_AI_MODELS.find {|m| m[:name] == "gpt-4o" } if model.nil?
22
22
  from_iso = ISO_639.find_by_code(from).english_name.split(";").first
23
23
  to_iso = to.map {|iso| [iso, ISO_639.find_by_code(iso).english_name.split(";").first] }
24
24
  headers = {
@@ -30,7 +30,7 @@ module ImmosquareTranslate
30
30
  "Rules to respect:\n" \
31
31
  "- Use ISO 639-1 language codes for specifying languages." \
32
32
  "- Respond with an array of a flat objects in JSON (minified, without any extraneous characters or formatting)\n" \
33
- "- Format the translation output as a JSON string adhering to the following structure: {\"datas\":[{\"locale_iso\": \"Translated Text\"}]}" \
33
+ "- Format the translation output as a JSON string adhering to the following structure: {\"datas\":[{\"locale_iso\": \"Translated Text\"}]} where locale_iso is the ISO 639-1 language code for specifying languages." \
34
34
  "- Ensure that the output does not include markdown (```json) or any other formatting characters. Adhere to the JSON structure meticulously.\n" \
35
35
  "- Correct any spelling or grammatical errors in the source text before translating.\n" \
36
36
  "- If the source language is also a target language, include the corrected version of the sentence for that language as well, if not dont include it.\n" \
@@ -1,3 +1,3 @@
1
1
  module ImmosquareTranslate
2
- VERSION = "0.1.8".freeze
2
+ VERSION = "0.1.10".freeze
3
3
  end
@@ -176,7 +176,7 @@ module ImmosquareTranslate
176
176
  ##============================================================##
177
177
  model_name = ImmosquareYaml.configuration.openai_model
178
178
  model = OPEN_AI_MODELS.find {|m| m[:name] == model_name }
179
- model = OPEN_AI_MODELS.find {|m| m[:name] == "gpt-4-0125-preview" } if model.nil?
179
+ model = OPEN_AI_MODELS.find {|m| m[:name] == "gpt-4o" } if model.nil?
180
180
 
181
181
  ##============================================================##
182
182
  ## Manage blank values
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immosquare-translate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - IMMO SQUARE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-05 00:00:00.000000000 Z
11
+ date: 2024-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubygems_version: 3.5.7
99
+ rubygems_version: 3.5.9
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: AI-powered translations for Ruby applications, supporting a wide range of