Skip to main content

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 request
  • request_body: the whole JSON object body sent witth the webhook request
  • self_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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sparkai-0.3.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file sparkai-0.3.0.tar.gz.

File metadata

  • Download URL: sparkai-0.3.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for sparkai-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b8eba0e5f0e0f55908b97faf7ce3cffb1cf92607875c9719a41e5b262d4af07b
MD5 4d8c368dac6b50cab5a0201073f9e62e
BLAKE2b-256 df3d01a40624a2c46f0dc3f524615f4854badeec9888f6314dbaa1d53fef4b79

See more details on using hashes here.

File details

Details for the file sparkai-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: sparkai-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for sparkai-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c397711ed0023c71652f7b8cc5966c12d62bd287247c01ed5c029ae57b714bc4
MD5 01d146b47607c7774f26c11cc462e224
BLAKE2b-256 4b83a2efe55853e5bab66464fabb89698e41b59713e8620f1fab3247a965ae94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page