krino-world (Python)
English | 简体中文
A Python client for the KRINO WORLD API. It needs Python 3.10+ and its only dependency is httpx.
pip install krino-world
Full reference and quick start: krinomatrix.com/global/developers (mainland China site).
Usage
from krino_world import Client, KrinoError
with Client(region="global") as kw: # "cn" for the mainland China site
kw.login("me", "secret") # or kw.register(...); the token is kept on the client
character = kw.characters()[0]
session = kw.start_session(character["id"])
print(session["greeting"])
# Whole reply
turn = kw.send(session["id"], "How was your day?")
print(turn["reply"]["content"])
# Streamed reply
for event in kw.stream(session["id"], "Tell me a story"):
if event.name == "delta":
print(event.data["text"], end="", flush=True)
elif event.name == "error":
print("\n", event.data["message"])
# Memories
kw.remember(character["id"], "I like plain rice", type="preference")
for m in kw.memories(character["id"]):
print(m["content"], m["reality"])
# Speech
audio, mime = kw.speak("Good night")
| Account | register, login, logout, me, health |
| Characters | characters, character, export_character |
| Chat | sessions, start_session, session, send, stream, gesture, end_session, delete_session |
| Memory | memories, remember, edit_memory, forget, restore, delete_memory |
| Voice | speak |
| Anything else | request(method, path, **httpx_kwargs) calls any endpoint under /api/ |
- Your own server:
Client(base_url="http://127.0.0.1:8630"). - Reuse a token:
Client(region="cn", token="…"). - A refused request raises
KrinoError, with.status(the HTTP status) and.message(the server's explanation). - The two regions have separate accounts. See Base URLs.
Metadata
Release files for krino-world 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| krino_world-0.1.0.tar.gz | 9.5 kB | Without provenance | Details for krino_world-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| krino_world-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for krino_world-0.1.0-py3-none-any.whl |
Total release size: 19.7 kB
Release files / krino_world-0.1.0.tar.gz
| Download URL | krino_world-0.1.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
552da2cc238b91a6742dec1941e05b500df9197fa82948081dc67294c6fd30dd
|
|
BLAKE2b-256 checksum How to use checksums |
8edb413430e9729d17a462dc60280516befec5569024ed855292ff54f8b4f77a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|
Release files / krino_world-0.1.0-py3-none-any.whl
| Download URL | krino_world-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64473d09b04e9492cf1fc564f185a19208d5c8b3e8eeb04b9cab8a3a7e5e5faf
|
|
BLAKE2b-256 checksum How to use checksums |
e131380d205f5f482d1ec12fee02b4bbf1b13c8b408339523cc290124ca1202d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|
Security for krino-world 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.