Spaces:
Sleeping
Sleeping
Download src/nodes/basic_chatbot_nodes.py from Shubhu07/statefulChatbot: direct link, hf CLI and curl.
- Browser
- Download file 400 Bytes
-
https://huggingface.co/spaces/Shubhu07/statefulChatbot/resolve/main/src/nodes/basic_chatbot_nodes.py
- Command line
-
hf download hf://spaces/Shubhu07/statefulChatbot/src/nodes/basic_chatbot_nodes.py
-
curl -L -o basic_chatbot_nodes.py https://huggingface.co/spaces/Shubhu07/statefulChatbot/resolve/main/src/nodes/basic_chatbot_nodes.py
400 Bytes
| import os | |
| import sys | |
| sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) | |
| from src.state.state import graphstate | |
| from langgraph.graph import START, END, StateGraph | |
| class BasicChatbotNodes: | |
| def __init__(self, model): | |
| self.llm = model | |
| def process(self, state: graphstate): | |
| return {"messages": | |
| self.llm.invoke(state["messages"])} | |