Skip to content

Example 3: Creating SA Readers Writers in Python using the sam_helpers

jmessias edited this page Jun 29, 2015 · 1 revision
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")