Initial commit

This commit is contained in:
Zach
2025-04-02 16:56:35 -04:00
committed by GitHub
commit 41ecb66b4a
13 changed files with 5254 additions and 0 deletions

26
nodes.py Normal file
View File

@@ -0,0 +1,26 @@
from pocketflow import Node
from utils.call_llm import call_llm
class GetQuestionNode(Node):
def exec(self, _):
# Get question directly from user input
user_question = input("Enter your question: ")
return user_question
def post(self, shared, prep_res, exec_res):
# Store the user's question
shared["question"] = exec_res
return "default" # Go to the next node
class AnswerNode(Node):
def prep(self, shared):
# Read question from shared
return shared["question"]
def exec(self, question):
# Call LLM to get the answer
return call_llm(question)
def post(self, shared, prep_res, exec_res):
# Store the answer in shared
shared["answer"] = exec_res