Class: GeminiCraft::CacheKeyGenerator
- Inherits:
-
Object
- Object
- GeminiCraft::CacheKeyGenerator
- Defined in:
- lib/gemini_craft/client.rb
Instance Method Summary collapse
- #generate(text, system_instruction, options) ⇒ Object
-
#initialize(model) ⇒ CacheKeyGenerator
constructor
A new instance of CacheKeyGenerator.
Constructor Details
#initialize(model) ⇒ CacheKeyGenerator
Returns a new instance of CacheKeyGenerator.
363 364 365 |
# File 'lib/gemini_craft/client.rb', line 363 def initialize(model) @model = model end |
Instance Method Details
#generate(text, system_instruction, options) ⇒ Object
367 368 369 370 371 372 373 374 375 376 |
# File 'lib/gemini_craft/client.rb', line 367 def generate(text, system_instruction, ) key_parts = [ @model, text, system_instruction, .to_s ] Digest::SHA256.hexdigest(key_parts.join("--")) end |