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: