trustgraph/tests/test-agent
2024-11-09 23:08:43 +00:00

21 lines
591 B
Python
Executable file

#!/usr/bin/env python3
import json
from trustgraph.clients.agent_client import AgentClient
p = AgentClient(pulsar_host="pulsar://localhost:6650")
q = "How many cats does Mark have? Calculate that number raised to 0.4 power. Is that number lower than the numeric part of the mission identifier of the Space Shuttle Challenger on its last mission? If so, give me an apple pie recipe, otherwise return a poem about cheese."
def think(x):
print(f"think: {x}")
def observe(x):
print(f"observe: {x}")
resp = p.request(
question=q, think=think, observe=observe,
)
print(resp)