Skip to main content

No project description provided

Project description

Pangram Labs Python Package

Installation

pip install pangram-sdk

Add your API key

Add your API key as an environment variable, or pass it directly to the Pangram constructor.

export PANGRAM_API_KEY=<your API key>
from pangram import Pangram
# If the environment variable PANGRAM_API_KEY is set:
pangram_client = Pangram()

# Otherwise, pass the API key directly:
my_api_key = ''  # Fill this in with your API key.
pangram_client = Pangram(api_key=my_api_key)

Make a request

from pangram import Pangram
pangram_client = Pangram()

result = pangram_client.predict(text)
# Score in range [0, 1] where 0 is human-written and 1 is AI-generated.
score = result['ai_likelihood']

Make a batch request

from pangram import Pangram
pangram_client = Pangram()

text_batch = ["abc", "def"]

results = pangram_client.batch_predict(text_batch)
for result in results:
    text = result['text']
    score = result['ai_likelihood']

Questions? Email support@pangram.com!

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

pangram_sdk-0.1.6.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

pangram_sdk-0.1.6-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file pangram_sdk-0.1.6.tar.gz.

File metadata

  • Download URL: pangram_sdk-0.1.6.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pangram_sdk-0.1.6.tar.gz
Algorithm Hash digest
SHA256 e46eb1254444b68731714204d71281f3ef75eb70ebdbb0c283a1776b127d7ae8
MD5 58bc82d70df1add85ecf22b6274f9a41
BLAKE2b-256 1dc8041a0750283ce8b371450447a12ae5681934f49933652cb7925561ea0fb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pangram_sdk-0.1.6.tar.gz:

Publisher: publish-to-pypi.yml on pangramlabs/pangram-sdk

Attestations:

File details

Details for the file pangram_sdk-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pangram_sdk-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pangram_sdk-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d6bd1ef5e130566129523790529368c53c19e919dc4f7c68a6ffe6431a9410d7
MD5 c767ab5a64c1d63fc378a3b95d6e0852
BLAKE2b-256 0e20663fc5bfa48b8719d8ae1fd25ccd52b09fa09e4c745980d5bc71988a3f2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pangram_sdk-0.1.6-py3-none-any.whl:

Publisher: publish-to-pypi.yml on pangramlabs/pangram-sdk

Attestations:

Supported by

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