Class: Llmemory::LLM::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/llmemory/llm/base.rb

Direct Known Subclasses

Anthropic, OpenAI

Instance Method Summary collapse

Instance Method Details

#invoke(prompt) ⇒ Object

Raises:

  • (NotImplementedError)


6
7
8
# File 'lib/llmemory/llm/base.rb', line 6

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.



12
13
14
# File 'lib/llmemory/llm/base.rb', line 12

def invoke_with_json_schema(_prompt, _json_schema)
  nil
end