from superdialog import DialogMachine, Flowflow = Flow.load("appointment.json")dialog_machine = DialogMachine( flow=flow, llm="anthropic/claude-haiku-4-5", # runtime model - can differ from the build model)
from superdialog import DialogMachine, Flow, PythonTooldef lookup_customer(phone_number: str) -> dict: """Look up customer record by phone number.""" return crm.get_by_phone(phone_number)dialog_machine = DialogMachine( flow=Flow.load("appointment.json"), llm="anthropic/claude-haiku-4-5", tools=[PythonTool.of(lookup_customer)], # schema inferred from signature + docstring)
Or use the @tool decorator shorthand:
from superdialog.tools import tool@tooldef lookup_customer(phone_number: str) -> dict: """Look up customer record by phone number.""" return crm.get_by_phone(phone_number)dialog_machine = DialogMachine( flow=Flow.load("appointment.json"), llm="anthropic/claude-haiku-4-5", tools=[lookup_customer], # decorated function is already a PythonTool)