Module: PWN::AI::Agent::BTC

Defined in:
lib/pwn/ai/agent/btc.rb

Overview

This module is an AI agent designed to analyze Bitcoin blockchain information. It provides insights and summaries based on the latest block data retrieved from a Bitcoin node using PWN::Blockchain::BTC.get_latest_block.

Class Method Summary collapse

Class Method Details

.analyze(opts = {}) ⇒ Object

Supported Method Parameters

ai_analysis = PWN::AI::Agent::BTC.analyze(

request: 'required - latest block information retrieved from a bitcoin node via `PWN::Blockchain::BTC.get_latest_block`'

)



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/pwn/ai/agent/btc.rb', line 13

public_class_method def self.analyze(opts = {})
  request = opts[:request]
  raise 'ERROR: request parameter is required' if request.nil? || request.empty?

  system_role_content = 'Provide a useful summary of this latest bitcoin block returned from a bitcoin node via getblockchaininfo.'

  PWN::AI::Introspection.reflect_on(
    system_role_content: system_role_content,
    request: request,
    suppress_pii_warning: true
  )
rescue StandardError => e
  raise e.backtrace
end

.authorsObject

Author(s)

0day Inc. <[email protected]>



30
31
32
33
34
# File 'lib/pwn/ai/agent/btc.rb', line 30

public_class_method def self.authors
  "AUTHOR(S):
    0day Inc. <[email protected]>
  "
end

.helpObject

Display Usage for this Module



38
39
40
41
42
43
44
45
46
# File 'lib/pwn/ai/agent/btc.rb', line 38

public_class_method def self.help
  puts "USAGE:
    ai_analysis = PWN::AI::Agent::BTC.analyze(
      request: 'required - latest block information retrieved from a bitcoin node via `PWN::Blockchain::BTC.get_latest_block`'
    )

    #{self}.authors
  "
end