Example 3: Creating SA Readers Writers in Python using the sam_helpers - larsys/monarch_situational_awareness GitHub Wiki

from sam_helpers.reader import SAMReader
from sam_helpers.writer import SAMWriter

#Easy method - use sam_helpers.reader.SAMReader
rc = SAMReader("Slot C",callback)

#For slot groups, specify the agent through the ‘agent_name’ argument
rc = SAMReader("Predicate", callback_p, agent_name=”mbot01”)

#It is even easier for writers. Call the writer.publish function when needed
wc = SAMWriter("Slot D")