Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@empiricalrun/llm
Advanced tools
Package to connect and trace LLM calls.
import { LLM } from "@empiricalrun/llm";
const llm = new LLM({
provider: "openai",
defaultModel: "gpt-4o",
});
const llmResponse = await llm.createChatCompletion({ ... });
This package also contains utilities for vision, e.g. extract text (OCR).
import { extractText } from "@empiricalrun/llm/vision";
// With Appium
const data = await driver.saveScreenshot('dummy.png');
const instruction = "Extract number of ATOM tokens from the image. Return only the number.";
const text = await extractText(data.toString('base64'), instruction);
// Example response: "0.01"
import { getBoundingBox } from "@empiricalrun/llm/vision";
// With Appium
const data = await driver.saveScreenshot('dummy.png');
// Give a line describing the screen and then the element that you want to find
const instruction = "This screenshot shows a screen to send crypto tokens. What is the bounding box for the dropdown to select the token?";
const bbox = await getBoundingBox(data.toString('base64'), instruction);
const centerToTap = bbox.center; // { x: 342, y: 450 }
// **Note**: These coordinates are relative to the image dimensions, and actions like
// tap require scaling the coordinates to Appium coordinates
Bounding box can require some prompt iterations, and you can do that with a debug
flag. This flag
copies the output of the operation to your clipboard (macOS only.)
Paste this output in the address bar of your browser to visualize the output.
const bbox = await getBoundingBox(data.toString('base64'), instruction, { debug: true });
Example script for prompt iterations. The package should be installed and available to this script.
// Create script.mjs
// Run as `node script.mjs`
import fs from "fs";
import { getBoundingBox } from "@empiricalrun/llm/vision";
async function main() {
const prompt = "What is the bounding box for the first dropdown menu?";
const imagePath = "/path/to/the/image.png";
const imageData = fs.readFileSync(imagePath).toString("base64");
await getBoundingBox(imageData, prompt, { debug: true });
// The debug output has been copied -- paste it in the web browser
}
main();
FAQs
Package to connect and trace LLM calls.
The npm package @empiricalrun/llm receives a total of 1,041 weekly downloads. As such, @empiricalrun/llm popularity was classified as popular.
We found that @empiricalrun/llm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.