bruteSourceBruteSession

class Session

Definitions

def self.from_jsonl(path)

  • deprecated

Signature

deprecated

Use Session.new(path:) instead.

Implementation

def self.from_jsonl(path)
  new(path: path)
end

def <<(msg)

Append a message and persist it to disk if a path is set.

Implementation

def <<(msg)
  super
  if @path
    File.open(@path, "a") { |f| f.puts(JSON.generate(msg.to_h)) }
  end
  self
end