cryptum 0.0.413 → 0.0.415
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 +10 -2
- data/lib/cryptum/open_ai.rb +2 -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: 2887eb2e6b6a4935edfb71aabd839d0cbc633f75ab6d0c7fac30187149e9d0dd
|
4
|
+
data.tar.gz: 88002f644e4d7b9839818c1df8487e14b004ebb46cb2f782c41272c8130a129d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81a1f5db054fcc8f599d59bf03f69627980f669f52af18343d7254b7b8b356a9ae6489df8f029bcba2a922082927fdb726eee19089df276ce81a99cddeb6bfc8
|
7
|
+
data.tar.gz: 1c94d64e561029e53e2a912e2befd9a8736a858a73ec45db77394b8daf359c3a1446a556ba7490572835e514d74c9355dcb25495e3f75089b47e2b30debef863
|
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
@@ -12,6 +12,8 @@ module Cryptum
|
|
12
12
|
which_self = opts[:which_self].to_s
|
13
13
|
event_history = opts[:event_history]
|
14
14
|
|
15
|
+
driver_name = File.basename($PROGRAM_NAME)
|
16
|
+
|
15
17
|
# Only attempt to exit gracefully if level == :error
|
16
18
|
exit_gracefully = false
|
17
19
|
|
@@ -24,8 +26,9 @@ module Cryptum
|
|
24
26
|
datetime_str = '%Y-%m-%d %H:%M:%S.%N%z'
|
25
27
|
|
26
28
|
# Always append to log file
|
27
|
-
|
28
|
-
|
29
|
+
log_file_path = '/tmp/cryptum.log'
|
30
|
+
log_file_path = "/tmp/cryptum-ai-#{session}-#{symbol}.json" if level == :learning
|
31
|
+
log_file = File.open(log_file_path, 'a')
|
29
32
|
|
30
33
|
# Leave 10 "old" log files where
|
31
34
|
# each file is ~ 1,024,000 bytes
|
@@ -42,12 +45,17 @@ module Cryptum
|
|
42
45
|
when :error
|
43
46
|
exit_gracefully = true
|
44
47
|
logger.level = Logger::ERROR
|
48
|
+
puts "\nERROR: See #{log_file_path} for more details." if driver_name == 'cryptum-repl'
|
45
49
|
when :fatal
|
46
50
|
# This is reserved for the Cryptum::UI::Exit module
|
47
51
|
# if the Interrupt or StandardError exceptions are
|
48
52
|
# triggered. This prevents infintely attempting to
|
49
53
|
# exit if something in the module fails.
|
50
54
|
logger.level = Logger::FATAL
|
55
|
+
if driver_name == 'cryptum-repl'
|
56
|
+
puts "\nFATAL ERROR: Event history cannot be saved."
|
57
|
+
puts "See #{log_file_path} for more details."
|
58
|
+
end
|
51
59
|
when :info, :learning
|
52
60
|
logger.level = Logger::INFO
|
53
61
|
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"
|
@@ -134,7 +134,7 @@ module Cryptum
|
|
134
134
|
response_history = opts[:response_history]
|
135
135
|
|
136
136
|
system_role_content = opts[:system_role_content]
|
137
|
-
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.'
|
138
138
|
system_role_content = response_history[:choices].first[:content] if response_history
|
139
139
|
|
140
140
|
system_role = {
|
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.415
|
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
|