jekyll-chatgpt-translate 0.0.38 → 0.0.39

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: 80751d33457d149991f93ebca9daf89429ba1709b7345e58d575968b789518a1
4
- data.tar.gz: b85c071213cf44098791d31d86fdf92cc386664bba2f15d16c04e8aed5edcb11
3
+ metadata.gz: b4ab44177f3ba1b8eb9fb9f705734c130a5aa50447fa3e40f746d43a0fbb2c74
4
+ data.tar.gz: 2516780138d056a38a1f8aac70fad9e4606043fb6d9808fdf7224d4e3a3e08c4
5
5
  SHA512:
6
- metadata.gz: fb1a09e8c6521002e20f664bdaf4ac343dbbb1c838e88bd596271c9f25ec06ac462d40b454a72233dcb8f3be344483ae94cc4621dd0ea0a2e4feb64976c14245
7
- data.tar.gz: 79b0d7871805fc4ce024135b9d8e52929dd06db1e39e325671fbc61be931084f7e72564a6a2d618b4fbe139b3cc6f5c0e4568d35a98bfe784a6436ece0f881b3
6
+ metadata.gz: 7b3dba562f9860cfb1c00198770ed637a75c85216e87b9f36bb4520d212ed8cdfb9b3332601571addab38b81011b92a24408c4142fe31130d75f94d09a4f62d6
7
+ data.tar.gz: b679a82e6e19e3954c3676c6b81ef240fadda14aa06c490577bcb51d2c5f9d39c7ee8b708cc998617101be95c4d3747a29976b006e7cdb8ed68dedb72d4ce482
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
29
29
  s.required_ruby_version = '>= 2.6'
30
30
  s.name = 'jekyll-chatgpt-translate'
31
- s.version = '0.0.38'
31
+ s.version = '0.0.39'
32
32
  s.license = 'MIT'
33
33
  s.summary = 'Translate Jekyll Pages Through ChatGPT'
34
34
  s.description = [
@@ -48,5 +48,6 @@ Gem::Specification.new do |s|
48
48
  s.add_runtime_dependency 'jekyll', '>= 3'
49
49
  s.add_runtime_dependency 'redcarpet', '>= 3'
50
50
  s.add_runtime_dependency 'ruby-openai', '>= 5'
51
+ s.add_runtime_dependency 'tiktoken_ruby', '>= 0.0.6'
51
52
  s.metadata['rubygems_mfa_required'] = 'true'
52
53
  end
@@ -25,6 +25,7 @@
25
25
  require 'jekyll'
26
26
  require 'openai'
27
27
  require 'iso-639'
28
+ require 'tiktoken_ruby'
28
29
  require_relative 'pars'
29
30
  require_relative 'prompt'
30
31
 
@@ -92,7 +93,7 @@ class GptTranslate::ChatGPT
92
93
  end
93
94
  accum = []
94
95
  until later[i].nil?
95
- already = accum.join.split.count
96
+ already = Tiktoken.encoding_for_model('gpt-4').encode(accum.join).length
96
97
  if already > window_length
97
98
  Jekyll.logger.debug("Already #{already} words, over the window_length of #{window_length}")
98
99
  break
@@ -23,5 +23,5 @@
23
23
  # SOFTWARE.
24
24
 
25
25
  module GptTranslate
26
- VERSION = '0.0.38'
26
+ VERSION = '0.0.39'
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-chatgpt-translate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.38
4
+ version: 0.0.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '5'
97
+ - !ruby/object:Gem::Dependency
98
+ name: tiktoken_ruby
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: 0.0.6
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: 0.0.6
97
111
  description: Add this plugin to your Jekyll site and all posts will be automatically
98
112
  translated to the languages of your choice through ChatGPT
99
113
  email: yegor256@gmail.com