-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_agent.py
More file actions
32 lines (24 loc) · 883 Bytes
/
Copy pathtest_agent.py
File metadata and controls
32 lines (24 loc) · 883 Bytes
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
#!/usr/bin/env python3
"""Quick test of LangClaw agent (no interactive input)."""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent / "src"))
from langchain_core.messages import HumanMessage
from langclaw.run import _build_runtime
def main():
config_path = Path(__file__).parent / "config.yaml"
runtime, _mem, agent_cfg, tools, _db, rag_info = _build_runtime(
"default", config_path
)
if rag_info:
print("RAG:", rag_info)
config = {"configurable": {"thread_id": "test-session-1"}}
result = runtime.invoke(
{"messages": [HumanMessage(content="What is 15 * 7? Use the calculator.")]},
config=config,
)
last = result["messages"][-1]
print("Response:", getattr(last, "content", str(last)))
print("Tools loaded:", [t.name for t in tools])
if __name__ == "__main__":
main()