Commit
·
b322163
1
Parent(s):
21f89f6
Implement test
Browse files- agentTest.py +15 -0
agentTest.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from langchain_core.messages import HumanMessage
|
| 2 |
+
from agents.agent import build_graph
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
# test
|
| 6 |
+
if __name__ == "__main__":
|
| 7 |
+
|
| 8 |
+
question = "When was a picture of St. Thomas Aquinas first added to the Wikipedia page on the Principle of double effect?"
|
| 9 |
+
# Build the graph
|
| 10 |
+
graph = build_graph()
|
| 11 |
+
# Run the graph
|
| 12 |
+
messages = [HumanMessage(content=question)]
|
| 13 |
+
messages = graph.invoke({"messages": messages})
|
| 14 |
+
for m in messages["messages"]:
|
| 15 |
+
m.pretty_print()
|