implemented basic belief-from-text extractor including demo version #13

Merged
s.o.h.luijkx merged 7 commits from feat/belief-from-text into dev 2025-10-29 14:31:37 +00:00
2 changed files with 1 additions and 27 deletions
Showing only changes of commit d05276b081 - Show all commits

View File

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

View File

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