Class: OllamaAgent::Runner
- Inherits:
-
Object
- Object
- OllamaAgent::Runner
- Defined in:
- lib/ollama_agent/runner.rb
Overview
Stable public facade for library consumers. Configure via Runner.build, then call #run.
Instance Attribute Summary collapse
-
#session_id ⇒ String?
readonly
The current session id.
Class Method Summary collapse
Instance Method Summary collapse
-
#assign_chat_model!(name) ⇒ String
Assign a new chat model.
-
#hooks ⇒ Streaming::Hooks
The hooks bus — attach subscribers before calling #run.
-
#model ⇒ String
The active model.
-
#run(query) ⇒ Object
Execute a query.
Instance Attribute Details
#session_id ⇒ String? (readonly)
Returns the current session id.
22 23 24 |
# File 'lib/ollama_agent/runner.rb', line 22 def session_id @session_id end |
Class Method Details
.build(root: Dir.pwd, model: nil, system_prompt: nil, stream: false, session_id: nil, resume: false, max_tokens: nil, context_summarize: false, max_retries: nil, audit: nil, read_only: false, skills_enabled: true, skill_paths: nil, confirm_patches: true, orchestrator: false, think: nil, http_timeout: nil, stdin: $stdin, stdout: $stdout, provider: nil, credentials: nil, permissions: nil, budget: nil, memory: nil, trace: false, logger: nil) ⇒ Runner
Build a configured Runner.
rubocop:disable Metrics/ParameterLists, Metrics/MethodLength – library facade must expose all Agent options
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/ollama_agent/runner.rb', line 51 def self.build( root: Dir.pwd, model: nil, system_prompt: nil, stream: false, session_id: nil, resume: false, max_tokens: nil, context_summarize: false, max_retries: nil, audit: nil, read_only: false, skills_enabled: true, skill_paths: nil, confirm_patches: true, orchestrator: false, think: nil, http_timeout: nil, stdin: $stdin, stdout: $stdout, # v2 platform options provider: nil, credentials: nil, # Array<Hash> — multi-key credential pool config permissions: nil, budget: nil, memory: nil, trace: false, logger: nil ) new( root: root, model: model, system_prompt: system_prompt, stream: stream, session_id: session_id, resume: resume, max_tokens: max_tokens, context_summarize: context_summarize, max_retries: max_retries, audit: audit, read_only: read_only, skills_enabled: skills_enabled, skill_paths: skill_paths, confirm_patches: confirm_patches, orchestrator: orchestrator, think: think, http_timeout: http_timeout, stdin: stdin, stdout: stdout, provider: provider, credentials: credentials, permissions: , budget: budget, memory: memory, trace: trace, logger: logger ) end |
Instance Method Details
#assign_chat_model!(name) ⇒ String
Assign a new chat model.
111 112 113 |
# File 'lib/ollama_agent/runner.rb', line 111 def assign_chat_model!(name) @agent.assign_chat_model!(name) end |
#hooks ⇒ Streaming::Hooks
Returns the hooks bus — attach subscribers before calling #run.
17 18 19 |
# File 'lib/ollama_agent/runner.rb', line 17 def hooks @agent.hooks end |
#model ⇒ String
Returns the active model.
104 105 106 |
# File 'lib/ollama_agent/runner.rb', line 104 def model @agent.model end |
#run(query) ⇒ Object
Execute a query. Blocks until the agent loop completes.
99 100 101 |
# File 'lib/ollama_agent/runner.rb', line 99 def run(query) agent.run(query) end |