Class: RubyLLM::Agents::ImageAnalyzer
- Inherits:
-
Object
- Object
- RubyLLM::Agents::ImageAnalyzer
- Extended by:
- DSL
- Includes:
- Execution
- Defined in:
- lib/ruby_llm/agents/image/analyzer.rb,
lib/ruby_llm/agents/image/analyzer/dsl.rb,
lib/ruby_llm/agents/image/analyzer/execution.rb
Overview
Image analyzer for understanding and captioning images
Analyzes images using vision models to extract captions, tags, descriptions, detected objects, and color information.
Defined Under Namespace
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#tenant_id ⇒ Object
readonly
Returns the value of attribute tenant_id.
Class Method Summary collapse
-
.call(image:, **options) ⇒ ImageAnalysisResult
Execute image analysis.
-
.inherited(subclass) ⇒ Object
Ensure subclasses inherit DSL settings.
Instance Method Summary collapse
-
#call ⇒ ImageAnalysisResult
Execute the image analysis.
-
#initialize(image:, **options) ⇒ ImageAnalyzer
constructor
Initialize a new image analyzer instance.
Methods included from Execution
Constructor Details
#initialize(image:, **options) ⇒ ImageAnalyzer
Initialize a new image analyzer instance
76 77 78 79 80 |
# File 'lib/ruby_llm/agents/image/analyzer.rb', line 76 def initialize(image:, **) @image = image @options = @tenant_id = nil end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
63 64 65 |
# File 'lib/ruby_llm/agents/image/analyzer.rb', line 63 def image @image end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
63 64 65 |
# File 'lib/ruby_llm/agents/image/analyzer.rb', line 63 def @options end |
#tenant_id ⇒ Object (readonly)
Returns the value of attribute tenant_id.
63 64 65 |
# File 'lib/ruby_llm/agents/image/analyzer.rb', line 63 def tenant_id @tenant_id end |
Class Method Details
.call(image:, **options) ⇒ ImageAnalysisResult
Execute image analysis
43 44 45 |
# File 'lib/ruby_llm/agents/image/analyzer.rb', line 43 def call(image:, **) new(image: image, **).call end |
.inherited(subclass) ⇒ Object
Ensure subclasses inherit DSL settings
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ruby_llm/agents/image/analyzer.rb', line 48 def inherited(subclass) super subclass.instance_variable_set(:@model, @model) subclass.instance_variable_set(:@analysis_type, @analysis_type) subclass.instance_variable_set(:@extract_colors, @extract_colors) subclass.instance_variable_set(:@detect_objects, @detect_objects) subclass.instance_variable_set(:@extract_text, @extract_text) subclass.instance_variable_set(:@custom_prompt, @custom_prompt) subclass.instance_variable_set(:@max_tags, @max_tags) subclass.instance_variable_set(:@version, @version) subclass.instance_variable_set(:@description, @description) subclass.instance_variable_set(:@cache_ttl, @cache_ttl) end |
Instance Method Details
#call ⇒ ImageAnalysisResult
Execute the image analysis
85 86 87 |
# File 'lib/ruby_llm/agents/image/analyzer.rb', line 85 def call execute end |