Class: Phronomy::Agent::ContextRequest
- Inherits:
-
Data
- Object
- Data
- Phronomy::Agent::ContextRequest
- Defined in:
- lib/phronomy/agent/context_request.rb
Instance Attribute Summary collapse
-
#agent_id ⇒ Object
readonly
Returns the value of attribute agent_id.
-
#call_mode ⇒ Object
readonly
Returns the value of attribute call_mode.
-
#call_sequence ⇒ Object
readonly
Returns the value of attribute call_sequence.
-
#candidates ⇒ Object
readonly
Returns the value of attribute candidates.
-
#execution_id ⇒ Object
readonly
Returns the value of attribute execution_id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#model_config ⇒ Object
readonly
Returns the value of attribute model_config.
-
#parts ⇒ Object
readonly
Returns the value of attribute parts.
-
#previous_manifest ⇒ Object
readonly
Returns the value of attribute previous_manifest.
-
#required_coverage ⇒ Object
readonly
Returns the value of attribute required_coverage.
-
#token_budget ⇒ Object
readonly
Returns the value of attribute token_budget.
Instance Method Summary collapse
-
#initialize(**values) ⇒ ContextRequest
constructor
A new instance of ContextRequest.
Constructor Details
#initialize(**values) ⇒ ContextRequest
Returns a new instance of ContextRequest.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/phronomy/agent/context_request.rb', line 18 def initialize(**values) super(**values.merge( agent_id: values.fetch(:agent_id).to_s.freeze, execution_id: values[:execution_id]&.to_s&.freeze, call_sequence: Integer(values.fetch(:call_sequence)), call_mode: values.fetch(:call_mode).to_sym, candidates: Array(values[:candidates]).freeze, model_config: Immutable.copy(values[:model_config] || {}), required_coverage: Array(values[:required_coverage]).map(&:to_s).freeze, parts: (values[:parts] || {}).dup.freeze, metadata: Immutable.copy(values[:metadata] || {}) )) raise ArgumentError, "ContextRequest call_sequence must be positive" unless call_sequence.positive? freeze end |
Instance Attribute Details
#agent_id ⇒ Object (readonly)
Returns the value of attribute agent_id
5 6 7 |
# File 'lib/phronomy/agent/context_request.rb', line 5 def agent_id @agent_id end |
#call_mode ⇒ Object (readonly)
Returns the value of attribute call_mode
5 6 7 |
# File 'lib/phronomy/agent/context_request.rb', line 5 def call_mode @call_mode end |
#call_sequence ⇒ Object (readonly)
Returns the value of attribute call_sequence
5 6 7 |
# File 'lib/phronomy/agent/context_request.rb', line 5 def call_sequence @call_sequence end |
#candidates ⇒ Object (readonly)
Returns the value of attribute candidates
5 6 7 |
# File 'lib/phronomy/agent/context_request.rb', line 5 def candidates @candidates end |
#execution_id ⇒ Object (readonly)
Returns the value of attribute execution_id
5 6 7 |
# File 'lib/phronomy/agent/context_request.rb', line 5 def execution_id @execution_id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
5 6 7 |
# File 'lib/phronomy/agent/context_request.rb', line 5 def @metadata end |
#model_config ⇒ Object (readonly)
Returns the value of attribute model_config
5 6 7 |
# File 'lib/phronomy/agent/context_request.rb', line 5 def model_config @model_config end |
#parts ⇒ Object (readonly)
Returns the value of attribute parts
5 6 7 |
# File 'lib/phronomy/agent/context_request.rb', line 5 def parts @parts end |
#previous_manifest ⇒ Object (readonly)
Returns the value of attribute previous_manifest
5 6 7 |
# File 'lib/phronomy/agent/context_request.rb', line 5 def previous_manifest @previous_manifest end |
#required_coverage ⇒ Object (readonly)
Returns the value of attribute required_coverage
5 6 7 |
# File 'lib/phronomy/agent/context_request.rb', line 5 def required_coverage @required_coverage end |
#token_budget ⇒ Object (readonly)
Returns the value of attribute token_budget
5 6 7 |
# File 'lib/phronomy/agent/context_request.rb', line 5 def token_budget @token_budget end |