Scribase-named re-export of @openjev/sdk's client, question helpers (choice/score/noul) and error types (ScribaseDecisionsClient alias for OpenJevClient), for the new Scribase Decisions product page/docs. No new wire behavior: same Jev-compatible /v1/systemone contract. Builds clean (tsdown) and `npm pack --dry-run` verified; not published (depends on the still-unpublished @openjev/sdk — see plans/openjev.md for the exact publish commands once the @scribase npm org exists and @openjev/sdk ships). Also cross-links the Python SDK README to scribase.com/decisions without republishing to PyPI. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
62 lines
2.2 KiB
Markdown
62 lines
2.2 KiB
Markdown
# @scribase/decisions
|
|
|
|
**Now part of Scribase: [scribase.com/decisions](https://scribase.com/decisions).**
|
|
|
|
Typed AI judgments (yes/no probability, category choice, numeric score) as a
|
|
backend primitive — a Scribase-named entry point for
|
|
[`@openjev/sdk`](https://github.com/caelum0x/openjev/tree/main/sdk/js). This
|
|
package re-exports that SDK's client, question helpers and error types under
|
|
Scribase naming; it adds no new wire behavior.
|
|
|
|
The wire contract is **Jev-compatible**: identical request and response
|
|
shapes to TypeSafe AI's hosted `/v1/systemone` API. Scribase did not build
|
|
Jev — OpenJev is an independent, Apache-2.0 open-source fork of TypeSafe's
|
|
Jev ("System One") engine and SDKs, maintained by the Scribase team. See
|
|
[NOTICE](./NOTICE) for full attribution.
|
|
|
|
## Status
|
|
|
|
Not yet published to npm (the `@openjev/sdk` dependency it wraps isn't
|
|
published yet either — see
|
|
[`plans/openjev.md`](https://github.com/caelum0x/openjev) in the owning
|
|
portfolio for the exact publish commands once the `@scribase` npm org
|
|
exists). Until published, build and pack it from a clone:
|
|
|
|
```sh
|
|
git clone https://github.com/caelum0x/openjev
|
|
cd openjev/sdk/js && npm install && npm run build && npm pack
|
|
cd ../scribase-decisions
|
|
npm install ../js/openjev-sdk-*.tgz --no-save # resolve @openjev/sdk locally for the build
|
|
npm install
|
|
npm run build
|
|
npm pack --dry-run # verify the tarball contents; does not publish
|
|
```
|
|
|
|
## Quickstart
|
|
|
|
```ts
|
|
import { choice, ScribaseDecisionsClient } from "@scribase/decisions";
|
|
|
|
// Self-hosted OpenJev engine (default http://localhost:8080), or a hosted
|
|
// Jev-compatible key: new ScribaseDecisionsClient({ baseUrl, apiKey })
|
|
const client = new ScribaseDecisionsClient();
|
|
|
|
const response = await client.systemOne({
|
|
state: { document: "I was charged twice. Please fix this ASAP." },
|
|
questions: {
|
|
category: choice("What is this support ticket about?", {
|
|
billing: null,
|
|
technical: null,
|
|
other: null,
|
|
}),
|
|
},
|
|
});
|
|
|
|
console.log(response.answers.category.choice); // "billing"
|
|
```
|
|
|
|
See [scribase.com/decisions](https://scribase.com/decisions) and
|
|
[docs.scribase.com/docs/decisions](https://docs.scribase.com/docs/decisions)
|
|
for the full quickstart, including the self-host path and the hosted
|
|
Jev-compatible key path.
|