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.3.0.tar.gz (24.8 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.3.0-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pie_client-0.3.0.tar.gz
  • Upload date:
  • Size: 24.8 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.3.0.tar.gz
Algorithm Hash digest
SHA256 f732f870662fbac53565ddf2fd3c593c742055289c4a1fcb0b6b5b7df4c17e05
MD5 d312331e4a00a79e72c36d365b3adfe0
BLAKE2b-256 b4cefc6532200e30863390364c15f3940fa5c2b726727ca7b711e1932514f06e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pie_client-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 30.5 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1eb99c37603b5a1cbcde7520027e957675d34e4716b6a4e515dd31a0bb4c2fc
MD5 ce0453105de152b60e7fa034498713e5
BLAKE2b-256 8e24217ab51591375dc004bf2dd8b2b240b37ccf995258831e8e2fe4882371c3

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