Merge remote-tracking branch 'origin/feat/belief-from-text' into feat/belief-from-text
# Conflicts: # src/control_backend/agents/bdi/test_agent.py # src/control_backend/main.py
This commit is contained in:
@@ -84,7 +84,7 @@ class BeliefFromText(CyclicBehaviour):
|
|||||||
'user_said' is relevant, so this function simply makes a dict with key: "user_said",
|
'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.
|
value: txt and passes this to the Belief Collector agent.
|
||||||
"""
|
"""
|
||||||
belief = {"user_said": [[txt]]}
|
belief = {"user_said": [txt]}
|
||||||
payload = json.dumps(belief)
|
payload = json.dumps(belief)
|
||||||
# TODO: Change to belief collector
|
# TODO: Change to belief collector
|
||||||
belief_msg = Message(to=settings.agent_settings.bdi_core_agent_name
|
belief_msg = Message(to=settings.agent_settings.bdi_core_agent_name
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
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)
|
|
||||||
Reference in New Issue
Block a user