Sylwanin
Sylwanin•2y ago

How to setup pay per results

Hello boys and girls, I'm thinking of switching an actor to pay per results, i didn't find any explicit exemple using the SDK, I setup the dataset unit name to my-actor-results will this be enough using python ? dataset_client = await Actor.open_dataset(name=‘my-actor-results') await dataset_client.push_data(data) Or should I also save results in default output dataset like: await Actor.push_data(data) What is the dataset unit name used for ? is it the name of dataset where actor output should be saved instead of default dataset of a run ?
8 Replies
Saurav Jain
Saurav Jain•2y ago
@memo23 maybe you can help the fellow developer friend 🙂
memo23
memo23•2y ago
@Saurav Jain @Sylwanin I am using just a dataset.push and also you can always try 🙂
Sylwanin
SylwaninOP•2y ago
what do you mean try ? how to make sure users are being charged for results if it's not set to the right dataset ^^ Do you use dataset.push on the dataset unit name you setup when publishing your actor to the store ? @Saurav Jain can we have a definitive answer , instead of "try" and risk being with a negative balance for the actor because the pay per results is badly setup ?
MEE6
MEE6•2y ago
@Sylwanin just advanced to level 2! Thanks for your contributions! 🎉
Sylwanin
SylwaninOP•2y ago
My question is prettry straight forward, When setting an actor on the store , should i use await Actor.push_data() to save results on the default dataset for each run Or do i have to create a dataset with the same dataset unit name (defined on the platform when publishing an actor to the store with pay per results pricing plan) dataset_client = await Actor.open_dataset(name=‘my-actor-results') await dataset_client.push_data(data)
ondro_k
ondro_k•2y ago
Hey @Sylwanin, PPR actors need to push items to their default dataset in order to charge users. Generally actors should push to default datasets (with await Actor.push_data()) so that one run's results don't get mixed with results from other runs.
Sylwanin
SylwaninOP•2y ago
Thank you !
xenial-black
xenial-black•6mo ago
@Sylwanin thanks do you have an example python code?

Did you find this page helpful?