Skip to main content

A Python client for the Playlab API

Project description

Playlab Python Client

A Python client for interacting with the Playlab API, enabling you to create interactive AI tutoring experiences.

Requirements

  • Python 3.7 or later

Installation

pip install playlab-api

Getting an API Key

To use the Playlab API, you'll need to obtain an API key.

  1. Log in to your account: Once your account is set up, log in at https://playlab.ai/login.
  2. Create and publish an app:
    • Navigate to a workspace within your organization or create a new one.
    • Create a new app within a workspace.
    • Develop your app using Playlab's tools.
    • Once ready, publish your app to your desired visibility.
    • Note down the project ID (also known as the app ID) - you'll need this for API calls.
      • The project ID can be found in the URL when you are on the project page as the group of characters after the last / .
      • For example, for: https://www.playlab.ai/build/clzni6ang00112by7c4vwbabc the project ID is: clzni6ang00112by7c4vwbabc
  3. Create an API Keys: In your organization's menu bar, look for the "API Keys" link in the upper-right side of the page.

Quick Start

from playlab_api import PlaylabApp

# Initialize the app with your API key and project ID
app = PlaylabApp(
    api_key="your_api_key_here",
    project_id="your_project_id_here"
)

# Send a message and get the response
response = app.send_message("Hello, AI!")

Environment Variables

You can set your API key and project ID using environment variables:

export PLAYLAB_API_KEY="your_api_key_here"
export PLAYLAB_PROJECT_ID="your_project_id_here"

Then initialize the app without parameters:

app = PlaylabApp()

Detailed Usage

Please refer to the usage.ipynb notebook for more detailed examples, including:

  • File attachments
  • Conversation management
  • History access
  • System prompts
  • Interactive chat

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

playlab_api-0.1.4.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

playlab_api-0.1.4-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file playlab_api-0.1.4.tar.gz.

File metadata

  • Download URL: playlab_api-0.1.4.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for playlab_api-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f4a810343b2fd5d5ca469dacfec9ed2fde1c1df74a1f9d74cf5482748fa5fe28
MD5 84017b32c9e8d770310bd3939bcd380d
BLAKE2b-256 b9b25e024adc00b1147de334c519c699ce842ad16fd2b64c9a7d74ae4896fa0b

See more details on using hashes here.

File details

Details for the file playlab_api-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: playlab_api-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for playlab_api-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5a431ef2cffc48d267fe8edb13aa4f5416e8771651a5209a9ff2ed985f14b0d4
MD5 a7d0eb07ca3ba97fc2a208074724665f
BLAKE2b-256 bd7a71f82f937e93e654a244d59ae4ed5fd76f9e113005fa613598062f78b64e

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