Closed Pwntus closed 1 year ago
Also, I personally think it is confusing to change the param name of webhook_events_filter
to webhookEvents
since that is what it is called in Replicate's API.
You are right, webhook_completed
should have just been webhook
. v0.4.4 fixes that and adds a test to assure that predictions with webhooks can be created without errors.
I understand that it is a bit confusing that the name is different from the one used in the API. My reasoning was that the consumers of this library are using it in TypeScript and expect to be able to use camel case names. I tried to mostly keep the original names but make them more concise if possible. I the parameter would be suffixed with filter
in TypeScript it probably creates some confusion, because I would expect to be able to pass a filter function. Just using webhookEvents
makes it clear that the parameter is a list of events.
Sound reasonable! Thank you for the update :)
Sorry I haven't had time to find the root cause but this error will keep showing up while trying to use webhooks with/without webhookEvents parameter when creating a prediction.
Most likely the cause is this line here where
webhook_completed
should be justwebhook
: https://github.com/zebreus/replicate-api/blob/master/src/predict.ts#L64