added basic chatbot
Browse files
src/langgraphagenticai/nodes/basic_chatbot_node.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from src.langgraphagenticai.state.state import State
|
| 2 |
+
|
| 3 |
+
class BasicChatbotNode:
|
| 4 |
+
"""
|
| 5 |
+
Basic chatbot logic implementation.
|
| 6 |
+
"""
|
| 7 |
+
def __init__(self,model):
|
| 8 |
+
self.llm = model
|
| 9 |
+
|
| 10 |
+
def process(self, state: State) -> dict:
|
| 11 |
+
"""
|
| 12 |
+
Processes the input state and generates a chatbot response.
|
| 13 |
+
"""
|
| 14 |
+
return {"messages":self.llm.invoke(state['messages'])}
|