refactor: agents inherit logger from BaseAgent
Created a class `BaseAgent`, from which all agents inherit. They get assigned a logger with a nice name (something like `control_backend.agents.AgentName`). The BDI core takes care of its own logger, as bdi is still a module. ref: N25B-241
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import json
|
||||
|
||||
from spade.agent import Agent
|
||||
from spade.behaviour import OneShotBehaviour
|
||||
from spade.message import Message
|
||||
|
||||
from control_backend.core.config import settings
|
||||
|
||||
|
||||
class BeliefTextAgent(Agent):
|
||||
class SendOnceBehaviourBlfText(OneShotBehaviour):
|
||||
async def run(self):
|
||||
@@ -12,7 +15,15 @@ class BeliefTextAgent(Agent):
|
||||
# Send multiple beliefs in one JSON payload
|
||||
payload = {
|
||||
"type": "belief_extraction_text",
|
||||
"beliefs": {"user_said": ["hello test","Can you help me?","stop talking to me","No","Pepper do a dance"]}
|
||||
"beliefs": {
|
||||
"user_said": [
|
||||
"hello test",
|
||||
"Can you help me?",
|
||||
"stop talking to me",
|
||||
"No",
|
||||
"Pepper do a dance",
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
msg = Message(to=to_jid)
|
||||
|
||||
Reference in New Issue
Block a user