Class: OllamaAgent::RuntimeCommandSystem::Session::Runtime
- Inherits:
-
Object
- Object
- OllamaAgent::RuntimeCommandSystem::Session::Runtime
- Defined in:
- lib/ollama_agent/runtime_command_system/session/runtime.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
Instance Method Summary collapse
- #active_model ⇒ Object
- #active_provider ⇒ Object
- #export_state ⇒ Object
-
#initialize(agent:) ⇒ Runtime
constructor
A new instance of Runtime.
- #state ⇒ Object
- #switch_model!(name, descriptor: nil) ⇒ Object
Constructor Details
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent.
9 10 11 |
# File 'lib/ollama_agent/runtime_command_system/session/runtime.rb', line 9 def agent @agent end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
9 10 11 |
# File 'lib/ollama_agent/runtime_command_system/session/runtime.rb', line 9 def events @events end |
Instance Method Details
#active_model ⇒ Object
16 17 18 |
# File 'lib/ollama_agent/runtime_command_system/session/runtime.rb', line 16 def active_model @agent.model end |
#active_provider ⇒ Object
20 21 22 |
# File 'lib/ollama_agent/runtime_command_system/session/runtime.rb', line 20 def active_provider @agent.provider_name end |
#export_state ⇒ Object
34 35 36 |
# File 'lib/ollama_agent/runtime_command_system/session/runtime.rb', line 34 def export_state state.merge(timestamp: Time.now.iso8601) end |
#state ⇒ Object
30 31 32 |
# File 'lib/ollama_agent/runtime_command_system/session/runtime.rb', line 30 def state { model: active_model, provider: active_provider } end |
#switch_model!(name, descriptor: nil) ⇒ Object
24 25 26 27 28 |
# File 'lib/ollama_agent/runtime_command_system/session/runtime.rb', line 24 def switch_model!(name, descriptor: nil) @agent.assign_chat_model!(name) @events.emit(:model_switched, model: name, descriptor: descriptor) name end |