Hi! The prodigy.serve
function is really only intended to run recipes that rely on the server being started. This depends on additional state, you couldn't just call the recipe function itself from Python. prodigy.serve
solves this.
For all other commands, there's nothing to serve and you can just call them from Python as regular functions.
from prodigy.recipes.commands import stats
stats()
We should raise a better error if the loaded controller is None
, because that typically indicates that the recipe doesn't return any components that can be served, and that the function can just be called from Python.