mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 03:31:02 +02:00
Agent infrastructure with client and stub server
This commit is contained in:
parent
30bc6f15da
commit
dbd20ea901
10 changed files with 288 additions and 5 deletions
21
tests/test-agent
Executable file
21
tests/test-agent
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/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)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue