chore: delete test_image_tool.py.
Browse files- test_image_tool.py +0 -30
test_image_tool.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
from agent import build_graph
|
| 3 |
-
from langchain_core.messages import HumanMessage, ToolMessage
|
| 4 |
-
from dotenv import load_dotenv
|
| 5 |
-
|
| 6 |
-
load_dotenv()
|
| 7 |
-
|
| 8 |
-
def test_image_process():
|
| 9 |
-
graph = build_graph()
|
| 10 |
-
question = "Review the chess position in the image: [Attached File Local Path: C:\\Users\\Admin\\.cache\\huggingface\\hub\\datasets--gaia-benchmark--GAIA\\snapshots\\682dd723ee1e1697e00360edccf2366dc8418dd9\\2023\\validation\\cca530fc-4052-43b2-b130-b30968d8aa44.png]"
|
| 11 |
-
|
| 12 |
-
print(f"--- Testing with question: {question} ---")
|
| 13 |
-
try:
|
| 14 |
-
result = graph.invoke({"messages": [HumanMessage(content=question)]})
|
| 15 |
-
|
| 16 |
-
# Log flow
|
| 17 |
-
for msg in result["messages"]:
|
| 18 |
-
if hasattr(msg, "tool_calls") and msg.tool_calls:
|
| 19 |
-
print(f"Model called tool: {msg.tool_calls[0]['name']}")
|
| 20 |
-
elif isinstance(msg, ToolMessage):
|
| 21 |
-
print(f"Tool returned: {msg.content[:100]}...")
|
| 22 |
-
elif hasattr(msg, "content") and msg.content:
|
| 23 |
-
if "FINAL ANSWER" in msg.content:
|
| 24 |
-
print(f"Final Answer Found: {msg.content}")
|
| 25 |
-
|
| 26 |
-
except Exception as e:
|
| 27 |
-
print(f"Error: {e}")
|
| 28 |
-
|
| 29 |
-
if __name__ == "__main__":
|
| 30 |
-
test_image_process()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|