replicate/replicate-python

Verifying webhooks

Closed this issue · 1 comments

It looks like only the javascriptand golang version of the client libraries have webhook validation right now. Would be great if this came to the Python library.

mattt commented

Hi @aaronn. That's a great suggestion! I just added this with #321 and #322, which are now available in 0.28.0.

import replicate

secret = replicate.webhooks.default.secret()

replicate.webhooks.validate(request=request, secret=secret)