LLM::OllamaAdapter
Inherits LLM::Adapter < Reference < Object
Adapter for Ollama (LLM::Ollama) with optional context reuse.
Constructors
new(client : LLM::Ollama)
SourceClass methods
Promoted to a class-level pure function so the flattening rule (system messages joined with \n\n, non-system/non-user roles dropped, nil system when no system messages were present) is unit-testable without standing up a real Ollama client.
Instance methods
client
SourceSend a single prompt and get a response as a String.
Send chat-style messages (system/user) and get a response as a String.
request_with_context(system : String | Nil, user : String, format : String = "json", cache_key : String | Nil = nil) : String
Context-aware request. Adapters that support provider-side context can reuse it using a cache_key. Default implementation falls back to request_messages without context reuse.