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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file promplate_pyodide-0.0.1.1.dev1.tar.gz
.
File metadata
- Download URL: promplate_pyodide-0.0.1.1.dev1.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.12.3 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea0f5902bd8667b7443f165581197edf6041453132ee248757596baf32bef28f |
|
MD5 | c9e990ec39f0d7501a19d2c7abafaebd |
|
BLAKE2b-256 | eb64c291963beae8c7de37e4bfa32d4f92e61e547dc1041d5c39473079e5283f |
File details
Details for the file promplate_pyodide-0.0.1.1.dev1-py3-none-any.whl
.
File metadata
- Download URL: promplate_pyodide-0.0.1.1.dev1-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.12.3 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dbfe43b76ebee50c2e4fede1f65051a019745bd56548dee0c012416c2fef956 |
|
MD5 | 601ee6fe4f4b9ac0466cb076310b87b5 |
|
BLAKE2b-256 | d0309fa1903291f1d4208e6778a912552473f9721db4cccfdfda58d70425cef8 |