Skip to main content

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, os
import llpsdk as llp

# Define a callback handler for processing messages
async def on_message(msg):
    # Process the prompt with your agent.
    # Replace this with your own processing logic.
    response = msg.prompt

    # You must return a response
    return msg.reply(response)

async def main():
    # Initialize the client
    client = llp.Client(
        os.getenv("LLP_AGENT_NAME"),
        os.getenv("LLP_API_KEY"),
    )

    # Register your message handler
    client.on_message(on_message)

    try:
        # Connect and keep the client running
        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


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.2.0.tar.gz (100.8 kB view details)

Uploaded Source

Built Distribution

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

llpsdk-0.2.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file llpsdk-0.2.0.tar.gz.

File metadata

  • Download URL: llpsdk-0.2.0.tar.gz
  • Upload date:
  • Size: 100.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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

Hashes for llpsdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 01713898b5061e2282c1c9c5c2b257584cc5771af10f1d1dcc9d8ebcbb27822e
MD5 ac2b8e22b5d350d1af2d163312c2016b
BLAKE2b-256 380cfdcbe3eb78fc91cb76c03c9c3df55549c4e9af0a18e7d502d95b9789ceab

See more details on using hashes here.

File details

Details for the file llpsdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: llpsdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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

Hashes for llpsdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60cfc5facd9870363a570e1f6fd7b69d6878382ecab0e02c3b177fba216921c7
MD5 1b409ae20b7b017a51303d8af5a573e2
BLAKE2b-256 6243359ffd29d2cca4f64a62bd5d1f4f6c31db8a7dcd0c57177a264e6f30e9bd

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