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.
- Log in to your account: Once your account is set up, log in at https://playlab.ai/login.
- 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/clzni6ang00112by7c4vwbabcthe project ID is:clzni6ang00112by7c4vwbabc
- The project ID can be found in the URL when you are on the project page as the group of characters after the last
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file playlab_api-0.1.2.tar.gz.
File metadata
- Download URL: playlab_api-0.1.2.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c29ece23dc76d0b409139b0779a1a0a56c2c8b8980bdc35767f75b57459acb25
|
|
| MD5 |
4474f419d198a68c64289154122f9f7f
|
|
| BLAKE2b-256 |
b589e54b0c85d1555e6aedf5ce6d6f664b9e836648e3ed28491026e506d19dc1
|
File details
Details for the file playlab_api-0.1.2-py3-none-any.whl.
File metadata
- Download URL: playlab_api-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ed71e8d2a5acd3fba4715ef5c92c64da6df8ba2cd9ad5ee319ee39181c7280e
|
|
| MD5 |
217f28e55b983ac7676ea14f401df714
|
|
| BLAKE2b-256 |
56457b5d92f57237f5941f385f21492c33a897a5bb409099308a2c00e13a8d5c
|