Skip to main content

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).

API key

Sign in to KRINO WORLD and create a key under Settings → API keys. It starts with km_, is shown only once, and stays valid until you delete it. Keep it like a password; the easiest place is an environment variable:

export KRINO_API_KEY=km_...

Usage

from krino_world import Client, KrinoError

with Client(region="global") as kw:          # reads KRINO_API_KEY; "cn" for the mainland China site
    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").
  • Pass the key directly: Client(region="cn", api_key="km_…").
  • No key? kw.login("me", "secret") signs in with a password instead; that token expires after a week.
  • 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.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for krino-world 0.2.0
File Size Uploaded Provenance Actions
krino_world-0.2.0.tar.gz 9.9 kB Without provenance Details for krino_world-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for krino-world 0.2.0
File Interpreter ABI Platform Actions
krino_world-0.2.0-py3-none-any.whl Python 3 none any Details for krino_world-0.2.0-py3-none-any.whl

Total release size: 20.4 kB

Release files / krino_world-0.2.0.tar.gz

Download URL krino_world-0.2.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7c4801f1699b4ecdaba0589401afc2582bfe80665f6d3c6d49e9baa4e3511c36
BLAKE2b-256 checksum
How to use checksums
d2f7b111af473412aaf4b9829631adbdab4c11dcb91ad818dbbab30dda6dadd7
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.2.0-py3-none-any.whl

Download URL krino_world-0.2.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b854e39ee082d0b24d6b3a6c7bc5a219186d56e12d998f9cd4b8e39399e442a
BLAKE2b-256 checksum
How to use checksums
384a7a5299bcfd066345f47d4bd139e0913fdf5108056c4d52829cde5a837141
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.2.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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page