fix: beliefs now adhere to expected format
[
-before user_said belief was a list of lists of strings, now it's a list of strings
]
[ref]: N25B-206
This commit is contained in:
@@ -62,7 +62,7 @@ class ContinuousBeliefCollector(CyclicBehaviour):
|
||||
Expected 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"","Can you help me?","stop talking to me","No","Pepper do a dance"]}
|
||||
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ class ContinuousBeliefCollector(CyclicBehaviour):
|
||||
return
|
||||
|
||||
logger.info("BeliefCollector: forwarding %d beliefs.", len(beliefs))
|
||||
for belief_name, belief_lists in beliefs.items():
|
||||
for args in belief_lists:
|
||||
logger.info(" - %s %s", belief_name, " ".join(map(str, args)))
|
||||
for belief_name, belief_list in beliefs.items():
|
||||
for belief in belief_list:
|
||||
logger.info(" - %s %s", belief_name,str(belief))
|
||||
|
||||
await self._send_beliefs_to_bdi(beliefs, origin=origin)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ 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)
|
||||
|
||||
@@ -155,7 +155,7 @@ async def test_belief_text_values_not_lists(continuous_collector, mocker):
|
||||
async def test_belief_text_happy_path_logs_items_and_sends(continuous_collector, mocker):
|
||||
payload = {
|
||||
"type": "belief_extraction_text",
|
||||
"beliefs": {"user_said": [["hello", "test"], ["No"]]}
|
||||
"beliefs": {"user_said": ["hello test", "No"]}
|
||||
}
|
||||
# Your code calls self.send(..); patch it (or switch implementation to self.agent.send and patch that)
|
||||
continuous_collector.send = AsyncMock()
|
||||
Reference in New Issue
Block a user