Class: DeepAgents::Graph::ReactAgentWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/deepagents/graph.rb

Overview

Wrapper class to maintain compatibility with ReactAgent interface

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(langgraph_agent, tools, instructions, model, state) ⇒ ReactAgentWrapper

Returns a new instance of ReactAgentWrapper.



194
195
196
197
198
199
200
# File 'lib/deepagents/graph.rb', line 194

def initialize(langgraph_agent, tools, instructions, model, state)
  @langgraph_agent = langgraph_agent
  @tools = tools
  @instructions = instructions
  @model = model
  @state = state
end

Instance Attribute Details

#instructionsObject (readonly)

Returns the value of attribute instructions.



192
193
194
# File 'lib/deepagents/graph.rb', line 192

def instructions
  @instructions
end

#modelObject (readonly)

Returns the value of attribute model.



192
193
194
# File 'lib/deepagents/graph.rb', line 192

def model
  @model
end

#stateObject (readonly)

Returns the value of attribute state.



192
193
194
# File 'lib/deepagents/graph.rb', line 192

def state
  @state
end

#toolsObject (readonly)

Returns the value of attribute tools.



192
193
194
# File 'lib/deepagents/graph.rb', line 192

def tools
  @tools
end

Instance Method Details

#run(max_iterations = 10) ⇒ Object



202
203
204
# File 'lib/deepagents/graph.rb', line 202

def run(max_iterations = 10)
  @langgraph_agent.run(max_iterations: max_iterations)
end