API linkage complete

This commit is contained in:
Cyber MacGeddon 2024-11-09 18:35:39 +00:00
parent dbd20ea901
commit 86d2ce2f34
2 changed files with 18 additions and 4 deletions

View file

@ -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:

View file

@ -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: