@empiricalrun/llm
Advanced tools
Comparing version 0.7.4 to 0.8.0
# @empiricalrun/llm | ||
## 0.8.0 | ||
### Minor Changes | ||
- 1c4780e: feat: add recaptcha solver | ||
## 0.7.4 | ||
@@ -4,0 +10,0 @@ |
export { getBoundingBox } from "./bbox"; | ||
export { solveRecaptchaGrid } from "./captcha"; | ||
export { extractText } from "./extract"; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.extractText = exports.getBoundingBox = void 0; | ||
exports.extractText = exports.solveRecaptchaGrid = exports.getBoundingBox = void 0; | ||
var bbox_1 = require("./bbox"); | ||
Object.defineProperty(exports, "getBoundingBox", { enumerable: true, get: function () { return bbox_1.getBoundingBox; } }); | ||
var captcha_1 = require("./captcha"); | ||
Object.defineProperty(exports, "solveRecaptchaGrid", { enumerable: true, get: function () { return captcha_1.solveRecaptchaGrid; } }); | ||
var extract_1 = require("./extract"); | ||
Object.defineProperty(exports, "extractText", { enumerable: true, get: function () { return extract_1.extractText; } }); |
import { LLMProvider } from ".."; | ||
export declare function imageFormatForProvider(provider: LLMProvider, image: string): string; | ||
export declare function cropImage(base64Image: string, { x, y, width, height, }: { | ||
x: number; | ||
y: number; | ||
width: number; | ||
height: number; | ||
}): Promise<string>; | ||
//# sourceMappingURL=utils.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.imageFormatForProvider = void 0; | ||
exports.cropImage = exports.imageFormatForProvider = void 0; | ||
const sharp_1 = __importDefault(require("sharp")); | ||
function imageFormatForProvider(provider, image) { | ||
let base64Image = image; | ||
if (provider === "openai") { | ||
if (provider === "openai" || provider === "anthropic") { | ||
if (!image.startsWith("data:image")) { | ||
@@ -14,1 +18,10 @@ base64Image = `data:image/png;base64,${image}`; | ||
exports.imageFormatForProvider = imageFormatForProvider; | ||
async function cropImage(base64Image, { x, y, width, height, }) { | ||
const imgBuffer = Buffer.from(base64Image, "base64"); | ||
const img = (0, sharp_1.default)(imgBuffer); | ||
const croppedImage = await img | ||
.extract({ left: Math.floor(x), top: Math.floor(y), width, height }) | ||
.toBuffer(); | ||
return croppedImage.toString("base64"); | ||
} | ||
exports.cropImage = cropImage; |
{ | ||
"name": "@empiricalrun/llm", | ||
"version": "0.7.4", | ||
"version": "0.8.0", | ||
"main": "dist/index.js", | ||
@@ -29,3 +29,4 @@ "exports": { | ||
"openai": "^4.55.4", | ||
"portkey-ai": "^1.3.2" | ||
"portkey-ai": "^1.3.2", | ||
"sharp": "^0.33.5" | ||
}, | ||
@@ -32,0 +33,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
31823
30
575
6
+ Addedsharp@^0.33.5
+ Added@emnapi/runtime@1.3.1(transitive)
+ Added@img/sharp-darwin-arm64@0.33.5(transitive)
+ Added@img/sharp-darwin-x64@0.33.5(transitive)
+ Added@img/sharp-libvips-darwin-arm64@1.0.4(transitive)
+ Added@img/sharp-libvips-darwin-x64@1.0.4(transitive)
+ Added@img/sharp-libvips-linux-arm@1.0.5(transitive)
+ Added@img/sharp-libvips-linux-arm64@1.0.4(transitive)
+ Added@img/sharp-libvips-linux-s390x@1.0.4(transitive)
+ Added@img/sharp-libvips-linux-x64@1.0.4(transitive)
+ Added@img/sharp-libvips-linuxmusl-arm64@1.0.4(transitive)
+ Added@img/sharp-libvips-linuxmusl-x64@1.0.4(transitive)
+ Added@img/sharp-linux-arm@0.33.5(transitive)
+ Added@img/sharp-linux-arm64@0.33.5(transitive)
+ Added@img/sharp-linux-s390x@0.33.5(transitive)
+ Added@img/sharp-linux-x64@0.33.5(transitive)
+ Added@img/sharp-linuxmusl-arm64@0.33.5(transitive)
+ Added@img/sharp-linuxmusl-x64@0.33.5(transitive)
+ Added@img/sharp-wasm32@0.33.5(transitive)
+ Added@img/sharp-win32-ia32@0.33.5(transitive)
+ Added@img/sharp-win32-x64@0.33.5(transitive)
+ Addedcolor@4.2.3(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcolor-string@1.9.1(transitive)
+ Addeddetect-libc@2.0.3(transitive)
+ Addedis-arrayish@0.3.2(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedsharp@0.33.5(transitive)
+ Addedsimple-swizzle@0.2.2(transitive)
+ Addedtslib@2.8.1(transitive)