-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_loop.py
More file actions
40 lines (34 loc) · 1.11 KB
/
test_loop.py
File metadata and controls
40 lines (34 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import os
import sys
# Ensure the parent directory is in the path
sys.path.insert(0, os.path.abspath('.'))
from dotenv import load_dotenv
load_dotenv()
print("API KEY:", bool(os.getenv("GOOGLE_API_KEY")))
import asyncio
from langchain_core.messages import HumanMessage, AIMessage
from agent.state import AgentState
from agent.permanent_knowledge import PERMANENT_KNOWLEDGE
async def run_update():
from agent.graphs.mind import update_node
state = {
"messages": [
HumanMessage(content="Hello! My name is Devinda and my favorite number is 7.", name="User"),
AIMessage(content="Greeting! Nice to meet you Devinda.", name="Mind")
],
"temp_knowledge": {},
"permanent_knowledge": PERMANENT_KNOWLEDGE,
"generated_questions": [],
"brain_thought": None,
"mind_action": None
}
try:
print("Testing update_node...")
res = await update_node(state)
print("RESULT:")
print(res)
except Exception as e:
import traceback
traceback.print_exc()
if __name__ == "__main__":
asyncio.run(run_update())