feat: implement demo version for demo
ref: N25B-208
This commit is contained in:
@@ -80,7 +80,7 @@ class BeliefFromText(CyclicBehaviour):
|
||||
Demo version to process the transcription input to beliefs. For the demo only the belief 'user_said' is relevant so
|
||||
this function simply makes a dict with key: "user_said", value: txt and passes this to the Belief Collector agent.
|
||||
"""
|
||||
belief = {"user_said": [[txt]]}
|
||||
belief = {"user_said": [txt]}
|
||||
payload = json.dumps(belief)
|
||||
# TODO: Change to belief collector
|
||||
belief_msg = Message(to=settings.agent_settings.bdi_core_agent_name + '@' + settings.agent_settings.host, body=payload)
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import spade
|
||||
from spade.agent import Agent
|
||||
from spade.behaviour import OneShotBehaviour
|
||||
from spade.message import Message
|
||||
from control_backend.core.config import settings
|
||||
|
||||
class SenderAgent(Agent):
|
||||
class InformBehav(OneShotBehaviour):
|
||||
async def run(self):
|
||||
msg = Message(to=settings.agent_settings.text_belief_extractor_agent_name + '@' + settings.agent_settings.host) # Instantiate the message
|
||||
msg.body = "This is a test input to extract beliefs from.\n" # Set the message content
|
||||
|
||||
await self.send(msg)
|
||||
print("Message sent!")
|
||||
|
||||
# set exit_code for the behaviour
|
||||
self.exit_code = "Job Finished!"
|
||||
|
||||
# stop agent from behaviour
|
||||
await self.agent.stop()
|
||||
|
||||
async def setup(self):
|
||||
print("SenderAgent started")
|
||||
self.b = self.InformBehav()
|
||||
self.add_behaviour(self.b)
|
||||
@@ -36,10 +36,8 @@ async def lifespan(app: FastAPI):
|
||||
# Initiate agents
|
||||
bdi_core = BDICoreAgent(settings.agent_settings.bdi_core_agent_name + '@' + settings.agent_settings.host, "placeholder", "src/control_backend/agents/bdi/rules.asl")
|
||||
await bdi_core.start()
|
||||
text_belief_extractor = TBeliefExtractor(settings.agent_settings.belief_collector_agent_name + '@' + settings.agent_settings.host, "placehodler")
|
||||
text_belief_extractor = TBeliefExtractor(settings.agent_settings.belief_collector_agent_name + '@' + settings.agent_settings.host, "placeholder")
|
||||
await text_belief_extractor.start()
|
||||
test_agent = SenderAgent(settings.agent_settings.test_agent_name + '@' + settings.agent_settings.host, "placeholder")
|
||||
await test_agent.start()
|
||||
|
||||
yield
|
||||
|
||||
|
||||
Reference in New Issue
Block a user