Skip to main content
This example uses scriptedModel so it does not download a model. A device app uses the same runtime calls with Cactus or another Model. The model replies with one tool call, then a final message. The tool is pure, so an interrupted attempt may run again.
agent.start registers the agent, stores the run, and starts the driver. run.result() waits for the terminal message. It does not start a second driver. sqlite() with no path stores larkx.db in the application document directory. result.message is "Seal needs service." when the scripted model runs both responses. result.finish is "stop". Close the runtime when the application is finished with it. close() waits for in-flight steps and releases ownership. Do not call it from an engine hook.

Resume the same run

Recovery happens when the process opens the same database and the same agent name and version.
A committed step is not executed again. See Crash recovery.