SDKs

Two small clients, standard library only, in the repository under sdk/. Each has a runnable example and a test that runs against an isolated test-mode core.

Node (20 or newer) sdk/js/olix.mjs

sdk/examples/quickstart.mjs
// Run with OLIX_API_TOKEN set (and OLIX_API_URL if the gateway is not on 127.0.0.1:8780).
import { Olix } from "../js/olix.mjs";

const olix = new Olix();
console.log("status:", JSON.stringify(await olix.status()));
for await (const ev of olix.turn({ text: "Say hello in five words." })) {
  if (ev.type === "assistant_delta") process.stdout.write(ev.text);
  else if (ev.type === "task_complete") console.log(`\n[${ev.outcome}]`);
}
Real output
status: {"api":"v1","app":"sample-app","scopes":["chat","models"],"core":{"reachable":true,"protocol":"olix.codeui/1","active_turns":0},"turns_running":0}
stand-in reply to: Say hello in five words.
[answered]

Python sdk/python/olix.py

sdk/examples/quickstart.py
"""Run with OLIX_API_TOKEN set (and OLIX_API_URL if the gateway is not on 127.0.0.1:8780)."""
import os, sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "python"))
from olix import Olix

olix = Olix()
print("status:", olix.status())
for ev in olix.turn("Say hello in five words."):
    if ev["type"] == "assistant_delta":
        print(ev["text"], end="", flush=True)
    elif ev["type"] == "task_complete":
        print("\n[%s]" % ev["outcome"])
Real output
status: {'api': 'v1', 'app': 'sample-app', 'scopes': ['chat', 'models'], 'core': {'reachable': True, 'protocol': 'olix.codeui/1', 'active_turns': 0}, 'turns_running': 0}
stand-in reply to: Say hello in five words.
[answered]

Methods

NodePythonendpoint
turn({text, cwd, session_id, model})turn(text, **opts)POST /v1/turns (stream)
ask(text, opts)ask(text, **opts)POST /v1/turns (wait)
interrupt(id), deny(id, qid, reason)interrupt, denyturn control (no approve exists)
sessions(), session(id), changes(id)same namesGET /v1/sessions...
models(), status(), settingsSchema()models, status, settings_schemaGET /v1/models ...
history(), historyGet(id), historySearch(q, cwd)history, history_get, history_searchneeds history.read

Errors raise OlixError with status and code. The base URL and token come from the constructor or OLIX_API_URL and OLIX_API_TOKEN. For completions use the official OpenAI SDK (see Models).

Coming A Mycel SDK, after the Mycel language ships.

Run the SDK tests

Commands
cd olxcore && npx tsc -p tsconfig.json && cd ..
python3 sdk/run_tests.py