prodigy.serve not working with custom recipes via python

I have a main.py that runs

prodigy.serve(command)

where -F recipes.py is part of the command.

But I get an error when I run python main.py

✘ Can't find recipe 'outlook.textcat.teach'

However running prodigy {command} works just fine. How come?

Ah, this should probably be more clear in the docs, sorry! If you're already in a Python script, there's not really a point in using the -F flag to point it to yet another Python file. You can just import your recipe function and the @prodigy.recipe decorator will take care of registering it.

1 Like

Indeed that solved it thanks