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.2a15.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

promplate_pyodide-0.0.2a15-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file promplate_pyodide-0.0.2a15.tar.gz.

File metadata

  • Download URL: promplate_pyodide-0.0.2a15.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.12.4 CPython/3.12.0

File hashes

Hashes for promplate_pyodide-0.0.2a15.tar.gz
Algorithm Hash digest
SHA256 4897df933af043b13e590dcdc196e7025415713bda488ad554a67618fa7d7051
MD5 570f315249691e27247435469a4dd3ef
BLAKE2b-256 6f6d15c5bf16739268978bd01947161b2c31fc0f9bcd92ddd99decb6264714b9

See more details on using hashes here.

File details

Details for the file promplate_pyodide-0.0.2a15-py3-none-any.whl.

File metadata

File hashes

Hashes for promplate_pyodide-0.0.2a15-py3-none-any.whl
Algorithm Hash digest
SHA256 f7a753cef220bd3623ee1bd5a6844739f223537b51b47805888be3aea5602e06
MD5 a994c8b1f1f96fa1b263f3874c8edc76
BLAKE2b-256 f3bf355f30f385687c7acf19f98b5e04126b89e0c2e456a2804ed92fb8c13abc

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