pi-jevisual
Pi extension: classify images independently with TypeSafe's Jev (choice, score, yes/no and bounding-box questions).
Package details
Install pi-jevisual from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-jevisual- Package
pi-jevisual- Version
0.1.0- Published
- Nov 11, 2026
- Downloads
- 366/mo · 366/wk
- Author
- piotradamm
- License
- MIT
- Types
- extension
- Size
- 16.7 KB
- Dependencies
- 2 dependencies · 3 peers
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-jevisual
A pi extension for classifying images with TypeSafe's Jev model (typesafe/jev-latest).
Each image is judged independently against the same set of named questions.
Install
pi install npm:pi-jevisual
Requires a TypeSafe API key, either in the TYPESAFE_API_KEY environment variable or stored in pi for the
typesafe provider. Without a key the tool stays registered but its calls fail with an error.
Tool: independently_classify_visuals
| Parameter | Description |
|---|---|
images |
One local image path or an array of paths, relative to the working directory or absolute. |
captions |
Optional caption per image, in the same order ("" for none). |
state |
Optional shared JSON context for the questions. |
questions |
Named questions, each with type, instructions and, depending on the type, criteria. |
Question types:
choice: pick one of several named criteria, e.g.{ "keep": "…", "discard": "…" }.score: a list of at least two criteria, giving a score.noul: yes/no, withcriteria: { "true": "…", "false": "…" }.box: a bounding box, instructions only.
The result has one entry per image, identified by its resolved path, with the answer to every question.
Images Jev cannot take (for example animated or multi-page images) are returned with unclassified and
the reason. Images are sent in batches of up to 24 MB.
The tool does not compare images with each other or classify them jointly.
API for other extensions
import { createClient, independentlyClassifyVisuals } from "pi-jevisual/api";
const results = await independentlyClassifyVisuals({
images: [buffer, "/path/to/figure.png"], // paths or image bytes
captions: ["Figure 1: wiring", undefined],
state: { task: "…" },
questions: { relevant: { type: "noul", instructions: "…", criteria: { true: "…", false: "…" } } },
client: createClient(apiKey), // optional; defaults to the client set up at session start
signal, // optional AbortSignal
});
Results come back in input order. Path inputs are identified by path, byte inputs by index.
pi-out-classify uses this API to classify images in
tool outputs.
Importing the API does not register the tool. To get the tool, install the package in pi as above.
Privacy
The images, captions and state are sent to TypeSafe's API.