Class: GraphAgent::Graph::Node
- Inherits:
-
Object
- Object
- GraphAgent::Graph::Node
- Defined in:
- lib/graph_agent/graph/node.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#cache_policy ⇒ Object
readonly
Returns the value of attribute cache_policy.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#retry_policy ⇒ Object
readonly
Returns the value of attribute retry_policy.
Instance Method Summary collapse
- #call(state, config = {}) ⇒ Object
-
#initialize(name, action, metadata: nil, retry_policy: nil, cache_policy: nil) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(name, action, metadata: nil, retry_policy: nil, cache_policy: nil) ⇒ Node
Returns a new instance of Node.
8 9 10 11 12 13 14 |
# File 'lib/graph_agent/graph/node.rb', line 8 def initialize(name, action, metadata: nil, retry_policy: nil, cache_policy: nil) @name = name.to_s @action = action @metadata = || {} @retry_policy = retry_policy @cache_policy = cache_policy end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
6 7 8 |
# File 'lib/graph_agent/graph/node.rb', line 6 def action @action end |
#cache_policy ⇒ Object (readonly)
Returns the value of attribute cache_policy.
6 7 8 |
# File 'lib/graph_agent/graph/node.rb', line 6 def cache_policy @cache_policy end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
6 7 8 |
# File 'lib/graph_agent/graph/node.rb', line 6 def @metadata end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/graph_agent/graph/node.rb', line 6 def name @name end |
#retry_policy ⇒ Object (readonly)
Returns the value of attribute retry_policy.
6 7 8 |
# File 'lib/graph_agent/graph/node.rb', line 6 def retry_policy @retry_policy end |
Instance Method Details
#call(state, config = {}) ⇒ Object
16 17 18 19 |
# File 'lib/graph_agent/graph/node.rb', line 16 def call(state, config = {}) result = execute_with_retry(state, config) normalize_result(result) end |