I want to use UiPath AI center to work on data, without training any model. Just a csv file as input, process the data with pandas script and then send back a csv file as an output.
Note that I am not using UiPath Studio to call the model, I am doing it with API calls.
How would I configure my predict function so that it returns a csv file as an output and not a JSON or a String.
To configure the predict function in UiPath AI Center to return a CSV file as an output, you need to modify the API endpoint to accept and return the CSV format.
Here are the steps to achieve this:
In the UiPath AI Center, create a new model and set the input and output types to “CSV”.
Write your Pandas script to process the input CSV file. Make sure to convert the data into a Pandas DataFrame.
In your Flask application, modify the predict function to return the processed data in CSV format. You can use the “pandas.DataFrame.to_csv()” method to convert the DataFrame to CSV format.
How do I modify the API endpoint to return the CSV format ? When I drop my ML Package I can configure my input to be a CSV, but for the output, I only give a text description.
The output format of an ML Model is predetermined by how the model was built. You won’t be able to change it. Best you could do is to process the output (whether it be plain text, json, whatever) into the format that you like.