Class: LangGraphRB::LLMNode
Overview
Specialized node for LLM calls
Instance Attribute Summary collapse
-
#llm_client ⇒ Object
readonly
Returns the value of attribute llm_client.
-
#system_prompt ⇒ Object
readonly
Returns the value of attribute system_prompt.
Attributes inherited from Node
Instance Method Summary collapse
- #call(state, context: nil) ⇒ Object
-
#initialize(name, llm_client:, system_prompt: nil, &block) ⇒ LLMNode
constructor
A new instance of LLMNode.
Methods inherited from Node
Constructor Details
#initialize(name, llm_client:, system_prompt: nil, &block) ⇒ LLMNode
Returns a new instance of LLMNode.
40 41 42 43 44 45 |
# File 'lib/langgraph_rb/node.rb', line 40 def initialize(name, llm_client:, system_prompt: nil, &block) @llm_client = llm_client @system_prompt = system_prompt super(name, &block) end |
Instance Attribute Details
#llm_client ⇒ Object (readonly)
Returns the value of attribute llm_client.
38 39 40 |
# File 'lib/langgraph_rb/node.rb', line 38 def llm_client @llm_client end |
#system_prompt ⇒ Object (readonly)
Returns the value of attribute system_prompt.
38 39 40 |
# File 'lib/langgraph_rb/node.rb', line 38 def system_prompt @system_prompt end |
Instance Method Details
#call(state, context: nil) ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/langgraph_rb/node.rb', line 47 def call(state, context: nil) # If no custom block provided, use default LLM behavior if @callable.nil? || @callable == method(:default_llm_call) default_llm_call(state, context) else super(state, context: context) end end |