I am writing a python function to generate a PDF file which I want to download from a Worshop app. In the button configuration I use function backed export for this and I see the option to export PDF there. However, when I try to return bytes from my python function, it does not show up in the list of functions I can select in the workshop app. When I return it as a valid base64 URI, the download function does not work. What is the right way to make this function work with the function backed export for PDF?
I believe the function output data type needs to be binary for PDF export in Workshop
but when I define the return type as binary (def generate_pdf(…) → bytes: ). The function does not show up in the list of functions in workshop
Looking at the types reference, it does look like bytes is the correct python return type that should map to binary. Perhaps there’s something going on in the function registry that is mixing up the type
Does your function look like this example?
The function shows up after I defined the return type as Binary, which is the equivalent of bytes from functions.api. But still this does not download the PDF file in Workshop.