Python SDK for Large Language Platform
Project description
LLP Python SDK
Python SDK for connecting to Large Language Platform.
Features
- Simple, intuitive async API
- Thread-safe message handling with asyncio
- WebSocket-based communication
Installation
# Using uv (recommended)
uv add llpsdk
# Using pip
pip install llpsdk
Quick Start
import asyncio
import llpsdk as llp
async def main() -> None:
"""Run a simple agent that connects and replies to prompts."""
api_key = os.getenv("LLP_API_KEY")
client = llp.Client("simple-agent", api_key, llp.Config())
# Set up handlers
async def on_message(msg: llp.TextMessage) -> llp.TextMessage:
print("Feed msg.prompt into your agent and return the response.")
return msg.reply("this is my response")
# Register your message handler
client.on_message(on_message)
try:
await client.connect()
print("Agent connected. Press Ctrl+C to exit...")
await asyncio.Event().wait()
finally:
await client.close()
asyncio.run(main())
Development
# Install with dev dependencies
uv sync --extra dev
# Run tests, type checking, and linting
make test
# Formatting
make format
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
llpsdk-0.1.0.tar.gz
(89.8 kB
view details)
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 llpsdk-0.1.0.tar.gz.
File metadata
- Download URL: llpsdk-0.1.0.tar.gz
- Upload date:
- Size: 89.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89d625afc5ebd0f9bf65f0c6c3ae604d985a4d9cb758a3670f238e9ae60e2b93
|
|
| MD5 |
fb4e79338c1688781c6be94df29cfb69
|
|
| BLAKE2b-256 |
5783ee409b15aa3c972c4de22a12a206214bd84d7a27369802ed9893f95cfb33
|
File details
Details for the file llpsdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llpsdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
762eec17888a1dafab34cf084bd235cd067749b8046c313e8a60164896d64fee
|
|
| MD5 |
ba371785184add4ddacc33179ab3c470
|
|
| BLAKE2b-256 |
0287f450334252e08b16d4476ad37a0afa1dda440d8e37bf61d9a2f7b046835c
|