Class: Llmemory::LLM::Base
- Inherits:
-
Object
- Object
- Llmemory::LLM::Base
- Defined in:
- lib/llmemory/llm/base.rb
Instance Attribute Summary collapse
-
#last_usage ⇒ Object
readonly
Returns the value of attribute last_usage.
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #invoke(prompt) ⇒ Object
-
#invoke_with_json_schema(_prompt, _json_schema) ⇒ Object
Optional: Structured Outputs (JSON schema).
Constructor Details
Instance Attribute Details
#last_usage ⇒ Object (readonly)
Returns the value of attribute last_usage.
9 10 11 |
# File 'lib/llmemory/llm/base.rb', line 9 def last_usage @last_usage end |
Instance Method Details
#invoke(prompt) ⇒ Object
15 16 17 |
# File 'lib/llmemory/llm/base.rb', line 15 def invoke(prompt) raise NotImplementedError, "#{self.class}#invoke must be implemented" end |
#invoke_with_json_schema(_prompt, _json_schema) ⇒ Object
Optional: Structured Outputs (JSON schema). Override in providers that support it (e.g. OpenAI). When not overridden, returns nil and callers should fall back to invoke + parse.
21 22 23 |
# File 'lib/llmemory/llm/base.rb', line 21 def invoke_with_json_schema(_prompt, _json_schema) nil end |