SparkAI official Python client library
Project description
sparkai-python-client
The official SparkAI Python client
Installation
$ pip install --upgrade sparkai
Usage
import sparkai.SparkAIClient
client = SparkAIClient('PROVIDED_API_KEY')
url = https://picsum.photos/200/300
instructions = 'Annotate any object in the photo'
token = client.create_engagement_from_image_url(url, instructions=instructions)
Validating webhook signature
client.validate_webhook_secret(request_secret_header, request_body, self_secret)
request_secret_header
: the whole header Spark-Signature sent with the webhook requestrequest_body
: the whole JSON object body sent witth the webhook requestself_secret
: customer's webhook token
Returns True if the signature is valid
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sparkai-0.3.0.tar.gz
(5.5 kB
view hashes)