immosquare-yaml 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immosquare-yaml/translate.rb +3 -3
- data/lib/immosquare-yaml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f1f9627fc2ca94a23182daf83ee3e7c4a91af11c49c2e3bfd2609544529af2e
|
4
|
+
data.tar.gz: bb4d7754edf9d2a5abc772945f977edf07be27f24c1dce0c6711f63ca0186b80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc931d730c8d64bdc0ea1af178317808e9b336b05b09fc2f06f07b5d08456a894fa22aa9765daca109abab45985dcde53f0c77af85e1410206862100a40066cf
|
7
|
+
data.tar.gz: 899a6c85464b7b37a3e1fd04e7dbd0a22fe1bd8e26d30570d37717b82087525a17135bad008c3a9a17081bed7b0354bec90fc41a43e5c7fcc4f56e52df31b7e2
|
@@ -248,13 +248,13 @@ module ImmosquareYaml
|
|
248
248
|
##============================================================##
|
249
249
|
## Loop
|
250
250
|
##============================================================##
|
251
|
-
puts("fields to translate : #{data_open_ai.size}#{" by group of #{group_size}" if data_open_ai.size > group_size}")
|
251
|
+
puts("fields to translate from #{from_iso} (#{from}) to #{to_iso} (#{to}) : #{data_open_ai.size}#{" by group of #{group_size}" if data_open_ai.size > group_size}")
|
252
252
|
while index < data_open_ai.size
|
253
253
|
data_group = data_open_ai[index, group_size]
|
254
254
|
|
255
255
|
|
256
256
|
begin
|
257
|
-
puts("call OPENAI Api (with model #{model[:name]}) #{" for #{data_group.size} fields" if data_open_ai.size > group_size}")
|
257
|
+
puts("call OPENAI Api (with model #{model[:name]}) #{" for #{data_group.size} fields (#{index}-#{index+data_group.size})" if data_open_ai.size > group_size}")
|
258
258
|
prompt = "#{prompt_init}:\n\n#{data_group.inspect}\n\n"
|
259
259
|
body = {
|
260
260
|
:model => model[:name],
|
@@ -265,7 +265,7 @@ module ImmosquareYaml
|
|
265
265
|
:temperature => 0.0
|
266
266
|
}
|
267
267
|
t0 = Time.now
|
268
|
-
call = HTTParty.post("https://api.openai.com/v1/chat/completions", :body => body.to_json, :headers => headers, :timeout =>
|
268
|
+
call = HTTParty.post("https://api.openai.com/v1/chat/completions", :body => body.to_json, :headers => headers, :timeout => 500)
|
269
269
|
|
270
270
|
puts("responded in #{(Time.now - t0).round(2)} seconds")
|
271
271
|
raise(call["error"]["message"]) if call.code != 200
|
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.
|
4
|
+
version: 0.1.8
|
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-09-
|
11
|
+
date: 2023-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iso-639
|