From 86d2ce2f34fdb4c9a44525ae36e64864012a8417 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Sat, 9 Nov 2024 18:35:39 +0000 Subject: [PATCH] API linkage complete --- .../trustgraph/clients/agent_client.py | 6 ++---- .../trustgraph/agent/react/service.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/trustgraph-base/trustgraph/clients/agent_client.py b/trustgraph-base/trustgraph/clients/agent_client.py index d96e2e88..2ef69274 100644 --- a/trustgraph-base/trustgraph/clients/agent_client.py +++ b/trustgraph-base/trustgraph/clients/agent_client.py @@ -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: diff --git a/trustgraph-flow/trustgraph/agent/react/service.py b/trustgraph-flow/trustgraph/agent/react/service.py index 88225f0e..754dc194 100755 --- a/trustgraph-flow/trustgraph/agent/react/service.py +++ b/trustgraph-flow/trustgraph/agent/react/service.py @@ -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: