mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-21 11:11: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):
|
||||
|
||||
print("inspect", x)
|
||||
|
||||
if x.thought and think:
|
||||
think(x.thought)
|
||||
return
|
||||
|
||||
if x.observation and observation:
|
||||
think(x.observation)
|
||||
if x.observation and observe:
|
||||
observe(x.observation)
|
||||
return
|
||||
|
||||
if x.answer:
|
||||
|
|
|
|||
|
|
@ -95,6 +95,16 @@ class Processor(ConsumerProducer):
|
|||
answer=None,
|
||||
error=None,
|
||||
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})
|
||||
|
|
@ -118,10 +128,14 @@ class Processor(ConsumerProducer):
|
|||
|
||||
self.recursive_input.send(r, properties={"id": id})
|
||||
|
||||
print("Done.", flush=True)
|
||||
|
||||
return
|
||||
|
||||
else:
|
||||
|
||||
print("Send response...", flush=True)
|
||||
|
||||
r = AgentResponse(
|
||||
answer="Here is the answer",
|
||||
error=None,
|
||||
|
|
@ -130,6 +144,8 @@ class Processor(ConsumerProducer):
|
|||
|
||||
self.producer.send(r, properties={"id": id})
|
||||
|
||||
print("Done.", flush=True)
|
||||
|
||||
return
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue