langgraph / src /basic_bot /chatbot_node.py
genaitiwari's picture
basic chatbot example - langgraph
b0540b3
raw
history blame contribute delete
403 Bytes
from src.LLMS.groqllm import GroqLLM
from src.state.state import State
class ChatbotNode:
"""
Basic chatbot logic implementation.
"""
def __init__(self,model):
self.llm = model
def process(self, state: State) -> dict:
"""
Processes the input state and generates a chatbot response.
"""
return {"messages":self.llm.invoke(state['messages'])}