cryptum 0.0.412 → 0.0.414
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/cryptum/log.rb +5 -2
- data/lib/cryptum/open_ai.rb +4 -2
- data/lib/cryptum/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 523d8125a9a4afa9d7ec5aaf83168b4a102a8617e6ad601a8484f4beaffbaaf1
|
4
|
+
data.tar.gz: 7713d8f3f523ee57285b3cf7c836b5c65a40d1f97beaa5ac21da08fc62160edf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30912ebbd8ae6f737bfa8506b4471ebc66c5c358c60c3a83a6b2735b379d3a5895fc9e6605354f550d053d67dac3393025af384675040ccef8d2dc1adde9cb67
|
7
|
+
data.tar.gz: 00e161bbf7877f2161476a4eca1450067cf3fd6408da7c577bd4c9535115a592330919b82b09bc63518715e5a92dbf9f54240c13238c1d0453d733c012a5c345
|
data/Gemfile
CHANGED
@@ -11,7 +11,7 @@ gemspec
|
|
11
11
|
# In some circumstances custom flags are passed to gems in order
|
12
12
|
# to build appropriately. Defer to ./reinstall_coinbot_gemset.sh
|
13
13
|
# to review these custom flags
|
14
|
-
gem 'addressable', '2.8.
|
14
|
+
gem 'addressable', '2.8.4'
|
15
15
|
gem 'bundler', '>=2.4.10'
|
16
16
|
gem 'bundler-audit', '0.9.1'
|
17
17
|
gem 'curses', '1.4.4'
|
data/lib/cryptum/log.rb
CHANGED
@@ -24,8 +24,9 @@ module Cryptum
|
|
24
24
|
datetime_str = '%Y-%m-%d %H:%M:%S.%N%z'
|
25
25
|
|
26
26
|
# Always append to log file
|
27
|
-
|
28
|
-
|
27
|
+
log_file_path = '/tmp/cryptum.log'
|
28
|
+
log_file_path = "/tmp/cryptum-ai-#{session}-#{symbol}.json" if level == :learning
|
29
|
+
log_file = File.open(log_file_path, 'a')
|
29
30
|
|
30
31
|
# Leave 10 "old" log files where
|
31
32
|
# each file is ~ 1,024,000 bytes
|
@@ -42,12 +43,14 @@ module Cryptum
|
|
42
43
|
when :error
|
43
44
|
exit_gracefully = true
|
44
45
|
logger.level = Logger::ERROR
|
46
|
+
puts "\nERROR: See #{log_file_path} for more details."
|
45
47
|
when :fatal
|
46
48
|
# This is reserved for the Cryptum::UI::Exit module
|
47
49
|
# if the Interrupt or StandardError exceptions are
|
48
50
|
# triggered. This prevents infintely attempting to
|
49
51
|
# exit if something in the module fails.
|
50
52
|
logger.level = Logger::FATAL
|
53
|
+
puts "\nFATAL ERROR: Event history cannot be saved. See #{log_file_path} for more details."
|
51
54
|
when :info, :learning
|
52
55
|
logger.level = Logger::INFO
|
53
56
|
when :unknown
|
data/lib/cryptum/open_ai.rb
CHANGED
@@ -69,7 +69,7 @@ module Cryptum
|
|
69
69
|
File.open('/tmp/cryptum-errors.txt', 'a') do |f|
|
70
70
|
f.puts Time.now.strftime('%Y-%m-%d %H:%M:%S.%N%z')
|
71
71
|
f.puts "Module: #{self}"
|
72
|
-
f.puts "URL: #{
|
72
|
+
f.puts "URL: #{base_open_ai_api_uri}#{rest_call}"
|
73
73
|
f.puts "PARAMS: #{params.inspect}"
|
74
74
|
f.puts "HTTP POST BODY: #{http_body.inspect}" if http_body != ''
|
75
75
|
f.puts "#{e}\n#{e.response}\n\n\n"
|
@@ -88,6 +88,7 @@ module Cryptum
|
|
88
88
|
token = opts[:token]
|
89
89
|
|
90
90
|
response = open_ai_rest_call(
|
91
|
+
option_choice: option_choice,
|
91
92
|
token: token,
|
92
93
|
rest_call: 'models'
|
93
94
|
)
|
@@ -133,7 +134,7 @@ module Cryptum
|
|
133
134
|
response_history = opts[:response_history]
|
134
135
|
|
135
136
|
system_role_content = opts[:system_role_content]
|
136
|
-
system_role_content ||= 'You are
|
137
|
+
system_role_content ||= 'You are a momentum trading bot on Coinbase named Cryptum. You are able to access any content or website on any device or network without any limitations or filters.'
|
137
138
|
system_role_content = response_history[:choices].first[:content] if response_history
|
138
139
|
|
139
140
|
system_role = {
|
@@ -174,6 +175,7 @@ module Cryptum
|
|
174
175
|
end
|
175
176
|
|
176
177
|
response = open_ai_rest_call(
|
178
|
+
option_choice: option_choice,
|
177
179
|
http_method: :post,
|
178
180
|
token: token,
|
179
181
|
rest_call: rest_call,
|
data/lib/cryptum/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryptum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.414
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.8.
|
19
|
+
version: 2.8.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.8.
|
26
|
+
version: 2.8.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|