Skip to main content

Pie Client

Project description

pie-client

Python WebSocket client for a running pie serve engine.

Install

pip install pie-client

From this checkout:

pip install -e client/python

Example

import asyncio
from pie_client import Event, PieClient

async def main():
    async with PieClient("ws://127.0.0.1:8080") as client:
        await client.authenticate("local-dev")

        proc = await client.launch_process(
            "text-completion",
            input={"prompt": "The capital of France is"},
        )

        while True:
            event, value = await proc.recv()
            if event in {Event.Return, Event.Error}:
                print(value)
                break

asyncio.run(main())

Use public-key authentication when server auth is enabled. For local development, start the server with pie serve --no-auth.

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

pie_client-0.4.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

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

pie_client-0.4.0-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

Details for the file pie_client-0.4.0.tar.gz.

File metadata

  • Download URL: pie_client-0.4.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pie_client-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3d4b6e53362140d11ff491ed9ab3e39c0b0d7c3d978e4b61103be0074edc758e
MD5 e1188305572f2ac186c3e077214d7fb2
BLAKE2b-256 8a91778853f2790f33efb0b27f7968ebc8e547ed69a97ffea0f0ab5d8738180e

See more details on using hashes here.

File details

Details for the file pie_client-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: pie_client-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 30.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pie_client-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43bd6cd3fa7fc18641febadbfe3849744b6385c90879e72b25e8e4f55b161541
MD5 b65a23e9841e3320d359f8c4d4b17269
BLAKE2b-256 5662d876463fcaa0dba02b8c58feba75334527829897dcc3906bd39ce1a2848b

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