Class: Pikuri::Agent::ChatTransport
- Inherits:
-
Object
- Object
- Pikuri::Agent::ChatTransport
- Defined in:
- lib/pikuri/agent/chat_transport.rb
Overview
The trio of arguments that has to travel together to RubyLLM.chat for model resolution to come out the same on every construction: the model id, the provider hint, and the registry-bypass flag.
Bundling them is structural protection against a recurring bug class — every forwarding site (the synthesizer rescue in #run_loop, Tool::SubAgent spawning a sub-agent) used to pass the three individually, and dropping one routed the spawned chat to a different server or raised RubyLLM::ModelNotFoundError on the unknown model id. With a single value object the call site can’t silently miss a field.
Pure data carrier: no RubyLLM references here, so the seam stays in Pikuri::Agent, bin/pikuri-chat, and Tool.
Instance Attribute Summary collapse
-
#assume_model_exists ⇒ Boolean
readonly
Forwarded to
RubyLLM.chat;trueskips ruby_llm’s registry lookup and trusts the supplied model id. -
#model ⇒ String?
readonly
LLM identifier;
nildefers toRubyLLM.config.default_modelat Pikuri::Agent construction time. -
#provider ⇒ Symbol?
readonly
Forwarded to
RubyLLM.chat.
Instance Method Summary collapse
-
#initialize(model:, provider: nil, assume_model_exists: false) ⇒ ChatTransport
constructor
A new instance of ChatTransport.
Constructor Details
#initialize(model:, provider: nil, assume_model_exists: false) ⇒ ChatTransport
Returns a new instance of ChatTransport.
36 37 38 |
# File 'lib/pikuri/agent/chat_transport.rb', line 36 def initialize(model:, provider: nil, assume_model_exists: false) super end |
Instance Attribute Details
#assume_model_exists ⇒ Boolean (readonly)
Returns forwarded to RubyLLM.chat; true skips ruby_llm’s registry lookup and trusts the supplied model id. Requires provider.
32 33 34 35 36 37 38 39 |
# File 'lib/pikuri/agent/chat_transport.rb', line 32 class ChatTransport < Data.define(:model, :provider, :assume_model_exists) # @param model [String, nil] # @param provider [Symbol, nil] # @param assume_model_exists [Boolean] def initialize(model:, provider: nil, assume_model_exists: false) super end end |
#model ⇒ String? (readonly)
Returns LLM identifier; nil defers to RubyLLM.config.default_model at Pikuri::Agent construction time.
32 33 34 35 36 37 38 39 |
# File 'lib/pikuri/agent/chat_transport.rb', line 32 class ChatTransport < Data.define(:model, :provider, :assume_model_exists) # @param model [String, nil] # @param provider [Symbol, nil] # @param assume_model_exists [Boolean] def initialize(model:, provider: nil, assume_model_exists: false) super end end |
#provider ⇒ Symbol? (readonly)
Returns forwarded to RubyLLM.chat. Required together with assume_model_exists when pointing at a local OpenAI-compatible server (llama.cpp, gpustack, …) whose model ids are not in ruby_llm’s bundled registry.
32 33 34 35 36 37 38 39 |
# File 'lib/pikuri/agent/chat_transport.rb', line 32 class ChatTransport < Data.define(:model, :provider, :assume_model_exists) # @param model [String, nil] # @param provider [Symbol, nil] # @param assume_model_exists [Boolean] def initialize(model:, provider: nil, assume_model_exists: false) super end end |