pwn 0.4.660 → 0.4.661

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: 9df12cf1f7713be0d0e51a67530a1358245af7bd35d9737df8ed70679aec5148
4
- data.tar.gz: e1e70483b477b3aec9c3e2680395973a588b89ce7b86da1fe680f5563f0c28bf
3
+ metadata.gz: bd98af58e97c52c8924292ab003cfa70bb8ae714506e962a278f233702cce8b4
4
+ data.tar.gz: ecca1f74b783a92ed4b8f31b23d088f2dddeb851cc37a95b63fba2a972f29313
5
5
  SHA512:
6
- metadata.gz: 4edfca0e6a37c6a8199dee90a4efb20c99e1f806848c0927a2febccfca78e5118053787f555aba4ae6dd843d682d81374ecdb006421032f2d96a2c81cf91daf1
7
- data.tar.gz: 697e30f757f956a8e6de26772c5e101c69c87f098ba2dacc2cdfb3cab4422850174b71399f3b6701af15ea420ffca8762e5256cb2e585928c1db0dad1e9a9a1e
6
+ metadata.gz: 8b3e154756cc071989a9aacee9cb0292bc42e48f58b3a0e085a0e27013336fdf2dab4f815a7e679920dc8c9c02992098d332553ab3e9001131880ea872dfd858
7
+ data.tar.gz: e5096825172efab4cf82f8389e118b96a0fba392649e37072b0a4cda4c123143a58ed4209662496b054d88a3d90b8536156c0b7c931450f8e973946ef5375080
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.2.2@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.660]:001 >>> PWN.help
40
+ pwn[v0.4.661]:001 >>> PWN.help
41
41
  ```
42
42
 
43
43
  [![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
@@ -52,7 +52,7 @@ $ rvm use ruby-3.2.2@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.660]:001 >>> PWN.help
55
+ pwn[v0.4.661]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -146,13 +146,14 @@ module PWN
146
146
 
147
147
  gpt = true if model.include?('gpt-3.5') || model.include?('gpt-4')
148
148
 
149
+ max_tokens = 4_096 - (request.to_s.length / 4)
150
+
149
151
  if gpt
150
152
  rest_call = 'chat/completions'
151
153
 
152
154
  response_history = opts[:response_history]
153
155
 
154
156
  max_tokens = response_history[:usage][:total_tokens] unless response_history.nil?
155
- max_tokens ||= 4_096 - (request.to_s.length / 4)
156
157
  max_tokens = 8_192 - (request.to_s.length / 4) if model.include?('gpt-4')
157
158
  max_tokens = 32_768 - (request.to_s.length / 4) if model.include?('gpt-4-32k')
158
159
  max_tokens = 300 unless max_tokens.positive?
@@ -191,7 +192,6 @@ module PWN
191
192
  else
192
193
  # Per https://openai.com/pricing:
193
194
  # For English text, 1 token is approximately 4 characters or 0.75 words.
194
- max_tokens = 4_097 - (request.to_s.length / 4)
195
195
  max_tokens = 300 unless max_tokens.positive?
196
196
 
197
197
  rest_call = 'completions'
@@ -541,7 +541,6 @@ module PWN
541
541
  public_class_method def self.delete_file(opts = {})
542
542
  token = opts[:token]
543
543
  file = opts[:file]
544
- raise "ERROR: #{file} not found." unless File.exist?(file)
545
544
 
546
545
  response = list_files(token: token)
547
546
  file_id = response[:data].select { |f| f if f[:filename] == File.basename(file) }.first[:id]
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.4.660'
4
+ VERSION = '0.4.661'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.660
4
+ version: 0.4.661
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.