← Catalog

pi-jevisual

Pi extension: classify images independently with TypeSafe's Jev (choice, score, yes/no and bounding-box questions).

Extension

Install

Install with PiG

pig install npm:pi-jevisual

Install with Pi

pi install npm:pi-jevisual
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.

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

ParameterDescription
imagesOne local image path or an array of paths, relative to the working directory or absolute.
captionsOptional caption per image, in the same order ("" for none).
stateOptional shared JSON context for the questions.
questionsNamed 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, with criteria: { "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.