pwn 0.4.619 → 0.4.620

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58a6651edf4d2111509bbfbace1caa37b7a5676e4324546264b0314ce0c8922c
4
- data.tar.gz: dffc41ac0228ac773889e33bc9a903c8a636bcd6b59d166b55e2b3e14fe6770c
3
+ metadata.gz: fafd153cff40ac71671f4350a1b00459b355b9648797f013c206272d42fa1d7e
4
+ data.tar.gz: 1915f04c0ee44c2e71a3b90208e3bffed04a2445a2bba3151900fb36fd46ad6c
5
5
  SHA512:
6
- metadata.gz: 931533d6769fb90d3f44c2f08f5159066fdf58a80fc6d9cd5418c2d5e0831a2933c99c6c93ae4b5a200406dfa919753a5772a457004276ca428155ea23a2d77a
7
- data.tar.gz: 4444938711c6afe3a8cae7ad2892c5ae6ad97548e85172c2533d884acfd47acfccfaa995091eb000b79eec45e7f7c036583c2089638bb5f1b3aac94c036bca47
6
+ metadata.gz: ff8533d123cd6ba697cd452d8526d11c82bed093f28cb2d5146396ebbf4df8b56ffffe343e32770f36cd9a12627b7a174d8b6bac8cc4ca4c569039a60e7c7dba
7
+ data.tar.gz: c4d482bd29938edf14ca98510ebc3885563f55000127c8a01d252a744dc6b671d4419bf89876dd3bafcfc8779c92b925785faeb605139d22b5c5ddb8501afbf3
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-ruby-3.2.1@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.619]:001 >>> PWN.help
40
+ pwn[v0.4.620]: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-ruby-3.2.1@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.619]:001 >>> PWN.help
55
+ pwn[v0.4.620]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -90,40 +90,6 @@ module PWN
90
90
  raise e
91
91
  end
92
92
 
93
- # Supported Method Parameters::
94
- # response = PWN::Plugins::OpenAI.legacy_chat(
95
- # token: 'required - Bearer token',
96
- # request: 'required - message to ChatGPT'
97
- # model: 'optional - model to use for text generation (defaults to gpt-3.5-turbo)',
98
- # temp: 'optional - creative response float (deafults to 0)',
99
- # max_tokens: 'optional - integer (defaults to 4_097 - request.length || 300)'
100
- # )
101
-
102
- public_class_method def self.legacy_chat(opts = {})
103
- token = opts[:token]
104
- request = opts[:request]
105
- model = opts[:model]
106
- model ||= 'text-davinci-003'
107
- temp = opts[:temp].to_f
108
- temp = 0 unless temp.positive?
109
- max_tokens = opts[:max_tokens].to_i
110
- max_tokens = 4_097 - request.to_s.length
111
- max_tokens = 300 unless max_tokens.positive?
112
-
113
- rest_call = 'completions'
114
-
115
- response = open_ai_rest_call(
116
- http_method: :post,
117
- token: token,
118
- rest_call: rest_call,
119
- http_body: http_body.to_json
120
- )
121
-
122
- JSON.parse(response, symbolize_names: true)
123
- rescue StandardError => e
124
- raise e
125
- end
126
-
127
93
  # Supported Method Parameters::
128
94
  # response = PWN::Plugins::OpenAI.chat(
129
95
  # token: 'required - Bearer token',
@@ -138,17 +104,19 @@ module PWN
138
104
  request = opts[:request]
139
105
  model = opts[:model]
140
106
  model ||= 'gpt-3.5-turbo'
107
+ # model ||= 'text-davinci-003'
141
108
  temp = opts[:temp].to_f
142
109
  temp = 0 unless temp.positive?
143
110
  max_tokens = opts[:max_tokens].to_i
144
111
  max_tokens = 4_097 - request.to_s.length
145
112
  max_tokens = 300 unless max_tokens.positive?
146
113
 
147
- rest_call = 'chat/completions'
148
-
149
114
  case model
150
115
  when 'text-davinci-002',
151
116
  'text-davinci-003'
117
+
118
+ rest_call = 'completions'
119
+
152
120
  http_body = {
153
121
  model: model,
154
122
  prompt: request,
@@ -157,6 +125,9 @@ module PWN
157
125
  }
158
126
  when 'gpt-3.5-turbo',
159
127
  'gpt-4'
128
+
129
+ rest_call = 'chat/completions'
130
+
160
131
  http_body = {
161
132
  model: model,
162
133
  messages: [
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.619'
4
+ VERSION = '0.4.620'
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.619
4
+ version: 0.4.620
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.