Class: Clacky::Media::Base
- Inherits:
-
Object
- Object
- Clacky::Media::Base
- Defined in:
- lib/clacky/media/base.rb
Overview
Abstract base for media (image / video / audio) generation providers.
Subclasses implement #generate_image (and later #generate_video, #generate_audio). The base class supplies the uniform success/error response shape and the on-disk persistence helper, mirroring the design used by Hermes’ image_gen_provider so the surface stays learnable across modalities.
Direct Known Subclasses
Instance Method Summary collapse
-
#generate_image(prompt:, aspect_ratio: "landscape", output_dir: nil, **_kwargs) ⇒ Hash
Either success_response(…) or error_response(…).
-
#initialize(model_entry) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(model_entry) ⇒ Base
Returns a new instance of Base.
19 20 21 22 23 24 |
# File 'lib/clacky/media/base.rb', line 19 def initialize(model_entry) @model_entry = model_entry @model = model_entry["model"] @base_url = model_entry["base_url"] @api_key = model_entry["api_key"] end |
Instance Method Details
#generate_image(prompt:, aspect_ratio: "landscape", output_dir: nil, **_kwargs) ⇒ Hash
Returns either success_response(…) or error_response(…).
27 28 29 |
# File 'lib/clacky/media/base.rb', line 27 def generate_image(prompt:, aspect_ratio: "landscape", output_dir: nil, **_kwargs) raise NotImplementedError, "#{self.class.name} must implement #generate_image" end |