Class: OmniAI::Tools::Browser::PageScreenshotTool

Inherits:
BaseTool
  • Object
show all
Defined in:
lib/omniai/tools/browser/page_screenshot_tool.rb

Overview

A browser automation tool for taking screenshots of the current page.

Instance Method Summary collapse

Methods inherited from BaseTool

#initialize

Constructor Details

This class inherits a constructor from OmniAI::Tools::Browser::BaseTool

Instance Method Details

#executeObject



12
13
14
15
16
17
18
# File 'lib/omniai/tools/browser/page_screenshot_tool.rb', line 12

def execute
  @logger.info("#{self.class.name}##{__method__}")

  @driver.screenshot do |file|
    "data:image/png;base64,#{Base64.strict_encode64(file.read)}"
  end
end