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.dev0.tar.gz
.
File metadata
- Download URL: promplate_pyodide-0.0.1.1.dev0.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 | 779e0202347f54f0e99cb5e20a99e4c7aa4bd456c826b2424718293ef44fed6d |
|
MD5 | b7524782fb9d5bce784d6ba3b95856e3 |
|
BLAKE2b-256 | 76f2173d211a0c2edee4c8a20aeb31d7ae601eae6e6094e392fff41ba23d1ea4 |
File details
Details for the file promplate_pyodide-0.0.1.1.dev0-py3-none-any.whl
.
File metadata
- Download URL: promplate_pyodide-0.0.1.1.dev0-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 | 3518c6380aa4aea1f7fa3562c726236b464600c5b5c73d76f3cedd2731c04577 |
|
MD5 | 78aa47995dede7768979f3c711951906 |
|
BLAKE2b-256 | 44d09825c888ed4e4c2daa918d707363613f760cdc4e30c5a8fe91ddac7bf551 |