mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-21 19:21:03 +02:00
API linkage complete
This commit is contained in:
parent
dbd20ea901
commit
86d2ce2f34
2 changed files with 18 additions and 4 deletions
|
|
@ -45,14 +45,12 @@ class AgentClient(BaseClient):
|
||||||
|
|
||||||
def inspect(x):
|
def inspect(x):
|
||||||
|
|
||||||
print("inspect", x)
|
|
||||||
|
|
||||||
if x.thought and think:
|
if x.thought and think:
|
||||||
think(x.thought)
|
think(x.thought)
|
||||||
return
|
return
|
||||||
|
|
||||||
if x.observation and observation:
|
if x.observation and observe:
|
||||||
think(x.observation)
|
observe(x.observation)
|
||||||
return
|
return
|
||||||
|
|
||||||
if x.answer:
|
if x.answer:
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,16 @@ class Processor(ConsumerProducer):
|
||||||
answer=None,
|
answer=None,
|
||||||
error=None,
|
error=None,
|
||||||
thought=thought,
|
thought=thought,
|
||||||
|
observation=None,
|
||||||
|
)
|
||||||
|
|
||||||
|
self.producer.send(r, properties={"id": id})
|
||||||
|
|
||||||
|
r = AgentResponse(
|
||||||
|
answer=None,
|
||||||
|
error=None,
|
||||||
|
thought=None,
|
||||||
|
observation="I have imagined myself",
|
||||||
)
|
)
|
||||||
|
|
||||||
self.producer.send(r, properties={"id": id})
|
self.producer.send(r, properties={"id": id})
|
||||||
|
|
@ -118,10 +128,14 @@ class Processor(ConsumerProducer):
|
||||||
|
|
||||||
self.recursive_input.send(r, properties={"id": id})
|
self.recursive_input.send(r, properties={"id": id})
|
||||||
|
|
||||||
|
print("Done.", flush=True)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
print("Send response...", flush=True)
|
||||||
|
|
||||||
r = AgentResponse(
|
r = AgentResponse(
|
||||||
answer="Here is the answer",
|
answer="Here is the answer",
|
||||||
error=None,
|
error=None,
|
||||||
|
|
@ -130,6 +144,8 @@ class Processor(ConsumerProducer):
|
||||||
|
|
||||||
self.producer.send(r, properties={"id": id})
|
self.producer.send(r, properties={"id": id})
|
||||||
|
|
||||||
|
print("Done.", flush=True)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue