Class: Ollama::PromptAdapters::Base
- Inherits:
-
Object
- Object
- Ollama::PromptAdapters::Base
- Defined in:
- lib/ollama/prompt_adapters/base.rb
Overview
Base prompt adapter — pass-through with no transformation. Subclasses override adapt_messages to apply model-family-specific prompt shaping (e.g. injecting think tags, reordering parts).
Instance Attribute Summary collapse
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
Instance Method Summary collapse
-
#adapt_messages(messages, think: false, tools: nil) ⇒ Array<Hash>
Transform messages for this model family.
-
#initialize(profile) ⇒ Base
constructor
A new instance of Base.
-
#inject_think_flag? ⇒ Boolean
Whether this adapter injects think: true into the API body.
Constructor Details
#initialize(profile) ⇒ Base
Returns a new instance of Base.
11 12 13 |
# File 'lib/ollama/prompt_adapters/base.rb', line 11 def initialize(profile) @profile = profile end |
Instance Attribute Details
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
9 10 11 |
# File 'lib/ollama/prompt_adapters/base.rb', line 9 def profile @profile end |
Instance Method Details
#adapt_messages(messages, think: false, tools: nil) ⇒ Array<Hash>
Transform messages for this model family. rubocop:disable Lint/UnusedMethodArgument -- keyword kept for subclass / duck-typed API
21 22 23 |
# File 'lib/ollama/prompt_adapters/base.rb', line 21 def (, think: false, tools: nil) end |
#inject_think_flag? ⇒ Boolean
Whether this adapter injects think: true into the API body. Gemma 4 uses a system-prompt tag instead, so returns false there.
28 29 30 |
# File 'lib/ollama/prompt_adapters/base.rb', line 28 def inject_think_flag? false end |