replicate / replicate-python

Python client for Replicate
https://replicate.com
Apache License 2.0
696 stars 194 forks source link

Verifying webhooks #312

Closed aaronn closed 1 week ago

aaronn commented 3 weeks ago

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 1 week ago

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)