immosquare-yaml 0.1.18 → 0.1.20

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: b76d6ea766d9bc5d5f3ea9a5ace5b5b1a53f7b033e336bb81271e8d65cacf0e3
4
- data.tar.gz: c69c1c1485d02964fe9ea740a3ab7b04328574507c6088fab28a15f288162177
3
+ metadata.gz: 467e395c6883993cd3a7496ca196e0aae40fc5b0b51159e8710b3b852cc8857f
4
+ data.tar.gz: b066518248c9f75656bc6fc880f14d82a78aae511272f353df7319ec2ec69bdd
5
5
  SHA512:
6
- metadata.gz: 86ce45abad8b0d94402ca4fd2e4b3bc82db7ba3f3d409faf20aa00d19a97de125104584d4d58ec98e51102053a0cf3183221acb40b444c785be762ae8b3b4ccd
7
- data.tar.gz: ba68b248e1880b476ea6bcf3c0703e1ffb45ec7c731f39adc670f17cea287148d47049ac0d6fb61bc1f40ed4aa953d4b40172b9b5e8a09f170983437233e3c75
6
+ metadata.gz: 64b828a55553839f8baa4f3da05ce2f2d7f7b6ef1d9a3340cf413467e27337db80b142ac7ae52742a74107175d7baa169e1fd7eab21d383b94888b2f754fd1ba
7
+ data.tar.gz: 7583b3bc085e7c25808cc4a0caec2b03cdd825929d7e79aa365b494a4546afbb0f9c3d393500c346fd640a4728e6f98abd70be21d948ce695e5efc0d82311c0b
@@ -174,10 +174,11 @@ module ImmosquareYaml
174
174
  ##============================================================##
175
175
  model_name = ImmosquareYaml.configuration.openai_model
176
176
  models = [
177
- {:name => "gpt-3.5-turbo", :tokens => 4097, :input => 0.0015, :output => 0.002, :group_size => 75},
178
- {:name => "gpt-3.5-turbo-16k", :tokens => 16_385, :input => 0.0030, :output => 0.004, :group_size => 300},
179
- {:name => "gpt-4", :tokens => 8192, :input => 0.0300, :output => 0.060, :group_size => 150},
180
- {:name => "gpt-4-32k", :tokens => 32_769, :input => 0.0600, :output => 0.120, :group_size => 600}
177
+ {:name => "gpt-3.5-turbo", :tokens => 4097, :input => 0.0015, :output => 0.002, :group_size => 75},
178
+ {:name => "gpt-3.5-turbo-16k", :tokens => 16_385, :input => 0.0030, :output => 0.004, :group_size => 300},
179
+ {:name => "gpt-4", :tokens => 8192, :input => 0.0300, :output => 0.060, :group_size => 150},
180
+ {:name => "gpt-4-32k", :tokens => 32_769, :input => 0.0600, :output => 0.120, :group_size => 600},
181
+ {:name => "gpt-4-1106-preview", :tokens => 128_000, :input => 0.0100, :output => 0.030, :group_size => 2400}
181
182
  ]
182
183
  model = models.find {|m| m[:name] == model_name }
183
184
  model = models.find {|m| m[:name] == "gpt-3.5-turbo-16k" } if model.nil?
@@ -1,3 +1,3 @@
1
1
  module ImmosquareYaml
2
- VERSION = "0.1.18".freeze
2
+ VERSION = "0.1.20".freeze
3
3
  end
@@ -240,48 +240,7 @@ module ImmosquareYaml
240
240
 
241
241
  private
242
242
 
243
- ##===========================================================================##
244
- ## This method ensures the file ends with a single newline, facilitating
245
- ## cleaner multi-line blocks. It operates by reading all lines of the file,
246
- ## removing any empty lines at the end, and then appending a newline.
247
- ## This guarantees the presence of a newline at the end, and also prevents
248
- ## multiple newlines from being present at the end.
249
- ##
250
- ## Params:
251
- ## +file_path+:: The path to the file to be normalized.
252
- ##
253
- ## Returns:
254
- ## The total number of lines in the normalized file.
255
- ##===========================================================================##
256
- def normalize_last_line(file_path)
257
- end_of_line = $INPUT_RECORD_SEPARATOR
258
- ##============================================================##
259
- ## Read all lines from the file
260
- ## https://gist.github.com/guilhermesimoes/d69e547884e556c3dc95
261
- ##============================================================##
262
- content = File.read(file_path)
263
-
264
243
 
265
- ##===========================================================================##
266
- ## Remove all trailing empty lines at the end of the file
267
- ##===========================================================================##
268
- content.gsub!(/#{Regexp.escape(end_of_line)}+\z/, "")
269
-
270
- ##===========================================================================##
271
- ## Append an EOL at the end to maintain the file structure
272
- ##===========================================================================##
273
- content << end_of_line
274
-
275
- ##===========================================================================##
276
- ## Write the modified lines back to the file
277
- ##===========================================================================##
278
- File.write(file_path, content)
279
-
280
- ##===========================================================================##
281
- ## Return the total number of lines in the modified file
282
- ##===========================================================================##
283
- content.lines.size
284
- end
285
244
 
286
245
  ##============================================================##
287
246
  ## Deeply cleans the specified YAML file
@@ -299,7 +258,7 @@ module ImmosquareYaml
299
258
  ## This also allows us to get the total number of lines in the file,
300
259
  ## helping us to determine when we are processing the last line
301
260
  ###===================================================================================#
302
- line_count = normalize_last_line(file_path)
261
+ line_count = File.normalize_last_line(file_path)
303
262
 
304
263
 
305
264
  File.foreach(file_path) do |current_line|
@@ -802,7 +761,7 @@ module ImmosquareYaml
802
761
  deep_transform_values(nested_hash) do |value|
803
762
  if value.is_a?(Array) && !value[0].nil? && value[0].instance_of?(String) && value[0].start_with?(CUSTOM_SEPARATOR) && value[0].end_with?(CUSTOM_SEPARATOR)
804
763
  style_type = value[0].gsub(CUSTOM_SEPARATOR, NOTHING)
805
- indent_supp = style_type.scan(/\d+/).first&.to_i || 0
764
+ indent_supp = style_type.scan(/\d+/).first.to_i
806
765
  indent_supp = [indent_supp - INDENT_SIZE, 0].max
807
766
  value[1] = value[1].map {|l| "#{SPACE * indent_supp}#{l}" }
808
767
  text = value[1].join(NEWLINE)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immosquare-yaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - IMMO SQUARE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-10 00:00:00.000000000 Z
11
+ date: 2024-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 0.1.11
36
+ version: 0.1.13
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 0.1.11
46
+ version: 0.1.13
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: iso-639
49
49
  requirement: !ruby/object:Gem::Requirement