Module: Smith::Agent::DynamicConfiguration
- Included in:
- Smith::Agent
- Defined in:
- lib/smith/agent/dynamic_configuration.rb
Instance Attribute Summary collapse
-
#model_block ⇒ Object
readonly
Returns the value of attribute model_block.
Instance Method Summary collapse
- #headers(**headers_kwargs, &block) ⇒ Object
- #instructions(text = nil, **prompt_locals, &block) ⇒ Object
- #model(model_id = nil, **options, &block) ⇒ Object
- #model_configured? ⇒ Boolean
- #params(**params_kwargs, &block) ⇒ Object
- #schema(value = nil, &block) ⇒ Object
- #tools(*tools, &block) ⇒ Object
Instance Attribute Details
#model_block ⇒ Object (readonly)
Returns the value of attribute model_block.
6 7 8 |
# File 'lib/smith/agent/dynamic_configuration.rb', line 6 def model_block @model_block end |
Instance Method Details
#headers(**headers_kwargs, &block) ⇒ Object
37 38 39 40 41 |
# File 'lib/smith/agent/dynamic_configuration.rb', line 37 def headers(**headers_kwargs, &block) return super unless block super(&wrap_runtime_block(block)) end |
#instructions(text = nil, **prompt_locals, &block) ⇒ Object
25 26 27 28 29 |
# File 'lib/smith/agent/dynamic_configuration.rb', line 25 def instructions(text = nil, **prompt_locals, &block) return super unless block super(text, **prompt_locals, &wrap_runtime_block(block)) end |
#model(model_id = nil, **options, &block) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/smith/agent/dynamic_configuration.rb', line 8 def model(model_id = nil, **, &block) return configure_dynamic_model(model_id, , block) if block @model_block = nil super end |
#model_configured? ⇒ Boolean
15 16 17 |
# File 'lib/smith/agent/dynamic_configuration.rb', line 15 def model_configured? !chat_kwargs[:model].nil? || !@model_block.nil? end |
#params(**params_kwargs, &block) ⇒ Object
31 32 33 34 35 |
# File 'lib/smith/agent/dynamic_configuration.rb', line 31 def params(**params_kwargs, &block) return super unless block super(&wrap_runtime_block(block)) end |
#schema(value = nil, &block) ⇒ Object
43 44 45 46 47 |
# File 'lib/smith/agent/dynamic_configuration.rb', line 43 def schema(value = nil, &block) return super unless block super(&wrap_runtime_block(block)) end |
#tools(*tools, &block) ⇒ Object
19 20 21 22 23 |
# File 'lib/smith/agent/dynamic_configuration.rb', line 19 def tools(*tools, &block) return super unless block super(&wrap_runtime_block(block)) end |