Skip to main content

patches for promplate-core for running in pyodide runtime

Project description

promplate-pyodide

Run your promplate project in the browser with pyodide!

Usage

If you just want to use its templating staff:

from micropip import install  # in pyodide runtime
await install("promplate-pyodide")

from promplate_pyodide import *
patch_promplate()

If you also want to use its OpenAI LLM, you should register the openai module because it is not compatible with pyodide. Note that you can register it as the JavaScript OpenAI SDK because its API is similar to the Python SDK.

patch_promplate(True)

This will patch ensure method to return a JavaScript array instead of a Python list. And it will remove sync APIs of promplate.llm.openai because the JavaScript OpenAI SDK is async-only.

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

promplate_pyodide-0.0.1.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

promplate_pyodide-0.0.1-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file promplate_pyodide-0.0.1.tar.gz.

File metadata

  • Download URL: promplate_pyodide-0.0.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.12.3 CPython/3.12.0

File hashes

Hashes for promplate_pyodide-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e8e141730c78bbb149398ab23467b8d76e546d5c53467fe21da194b386ed3d03
MD5 235f290eea7726569b53de2a60233953
BLAKE2b-256 e8676cdd7f4bd29b0fdb4d6124b4dcef6bfef3bb58756f4ac44e2ef75c1a55e2

See more details on using hashes here.

File details

Details for the file promplate_pyodide-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for promplate_pyodide-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91fede8a2b7f27f37af22c6424a04d49dc2483b55eb0218c957f72b2de79a628
MD5 56519ef4ca2bc77908930cdcadbd8f8d
BLAKE2b-256 3a605ce25549f71984909b8b02377a4078dfaf757c54765a0ae86b2eb0a73471

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page