@wrenautomation/read 0.36.1 → 0.36.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/video/gemini.d.ts +2 -2
- package/dist/video/gemini.js +10 -4
- package/dist/video/gemini.js.map +1 -1
- package/package.json +2 -2
package/dist/video/gemini.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Model, type Part } from "@wrenautomation/models";
|
|
2
|
-
/** Newest first: a busy or refused model hands the call to the next. */
|
|
2
|
+
/** Newest first: a busy or refused model hands the call to the next. Free-tier quota counts per model. */
|
|
3
3
|
export declare const GEMINI_MODELS: string[];
|
|
4
4
|
/** One read, every model, key and pass together, gives up after this long. */
|
|
5
5
|
export declare const READ_MS = 360000;
|
|
@@ -12,7 +12,7 @@ export declare const READ_TOKENS = 32000;
|
|
|
12
12
|
export declare const SHOWN: (start: number, paraphrase: boolean) => string;
|
|
13
13
|
/**
|
|
14
14
|
* The video reader on a Gemini key ring: `GEMINI_MODELS` in turn, each over every key that still
|
|
15
|
-
* works,
|
|
15
|
+
* works, five passes while they only say "later" (waits 2, 4, 8, 16 s). Null when no key works: a revoked fleet must
|
|
16
16
|
* not get a 14 MB inline body posted to each key.
|
|
17
17
|
*/
|
|
18
18
|
export declare function geminiVideo(keys: readonly string[], o?: {
|
package/dist/video/gemini.js
CHANGED
|
@@ -6,8 +6,14 @@
|
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
7
7
|
import { fallback, gemini, geminiLiveKeys, isCut, isFiltered, } from "@wrenautomation/models";
|
|
8
8
|
import { clock, runFor, TOOL_MS } from "./tools.js";
|
|
9
|
-
/** Newest first: a busy or refused model hands the call to the next. */
|
|
10
|
-
export const GEMINI_MODELS = [
|
|
9
|
+
/** Newest first: a busy or refused model hands the call to the next. Free-tier quota counts per model. */
|
|
10
|
+
export const GEMINI_MODELS = [
|
|
11
|
+
"gemini-3.8-flash",
|
|
12
|
+
"gemini-3.7-flash",
|
|
13
|
+
"gemini-3.6-flash",
|
|
14
|
+
"gemini-3.5-flash",
|
|
15
|
+
"gemini-3.5-flash-lite",
|
|
16
|
+
];
|
|
11
17
|
/** One call gives up after this long: a stalled socket would wait out undici's 5 minutes. */
|
|
12
18
|
const CALL_MS = 180_000;
|
|
13
19
|
/** One read, every model, key and pass together, gives up after this long. */
|
|
@@ -21,7 +27,7 @@ export const READ_TOKENS = 32_000;
|
|
|
21
27
|
export const SHOWN = (start, paraphrase) => `Transcribe in full, verbatim, every document, list, table, slide, template or other text the speaker shows on screen in this clip, each under a [h:mm:ss] heading of the video time it appears (the clip starts at ${clock(start)}). For every image, screenshot, chart, diagram or UI on screen, extract the information it carries, not what it looks like: the text in it, setting names and their values, numbers, prices, limits, labels, before and after states, and what is highlighted, circled, crossed out, ticked or pointed at. Write each as a line starting with its [h:mm:ss] then [visual], stating the fact as a reader would use it ("Instantly warmup settings: daily limit 10, slow ramp on, +1 per day, reply rate 95%"), not "a screenshot of the settings page". Skip visuals that carry no information (decoration, layout, gestures, transitions) and repeats of anything already captured. Skip the speaker's face, chat windows, b-roll and stock footage, and anything already shown earlier in the clip.${paraphrase ? " Where a shown passage is published text (a post, article, page), give its first line word for word, then every point it makes in your own words." : ""}`;
|
|
22
28
|
/**
|
|
23
29
|
* The video reader on a Gemini key ring: `GEMINI_MODELS` in turn, each over every key that still
|
|
24
|
-
* works,
|
|
30
|
+
* works, five passes while they only say "later" (waits 2, 4, 8, 16 s). Null when no key works: a revoked fleet must
|
|
25
31
|
* not get a 14 MB inline body posted to each key.
|
|
26
32
|
*/
|
|
27
33
|
export async function geminiVideo(keys, o = {}) {
|
|
@@ -34,7 +40,7 @@ export async function geminiVideo(keys, o = {}) {
|
|
|
34
40
|
*/
|
|
35
41
|
export function geminiReader(keys, o = {}) {
|
|
36
42
|
const wire = o.fetch ? { fetch: o.fetch } : {};
|
|
37
|
-
return fallback(GEMINI_MODELS.map((model) => gemini({ key: keys, model, limitMs: CALL_MS, ...wire })), { passes:
|
|
43
|
+
return fallback(GEMINI_MODELS.map((model) => gemini({ key: keys, model, limitMs: CALL_MS, ...wire })), { passes: 5 });
|
|
38
44
|
}
|
|
39
45
|
/**
|
|
40
46
|
* One read of media: the parts, then the ask. An answer the output cap cut keeps what it said. A
|
package/dist/video/gemini.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../src/video/gemini.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,QAAQ,EACR,MAAM,EACN,cAAc,EACd,KAAK,EACL,UAAU,GAGX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEpD,
|
|
1
|
+
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../src/video/gemini.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,QAAQ,EACR,MAAM,EACN,cAAc,EACd,KAAK,EACL,UAAU,GAGX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEpD,0GAA0G;AAC1G,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,uBAAuB;CACxB,CAAC;AACF,6FAA6F;AAC7F,MAAM,OAAO,GAAG,OAAO,CAAC;AACxB,8EAA8E;AAC9E,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,gGAAgG;AAChG,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC;AAElC;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAA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CAAC;IACzE,MAAM,KAAK,GAAG,MAAM,CAAC;IACrB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;IACvF,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;IACrD,MAAM,MAAM,CACV,MAAM,EACN;QACE,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC;QAC1C,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC;QAC9D,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QACpE,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAC7D,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC;QACrD,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,GAAG,CAAC;KACpC,EACD,OAAO,CACR,CAAC;IACF,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrenautomation/read",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.3",
|
|
4
4
|
"description": "The web and files in, text out. Polite HTTP fetching with robots and a fetch ladder up to a browser; HTML and PDF to text, a page to title, text and links; a video or podcast from a URL or a file (captions, ffmpeg and a vision model, audio to markdown, what a channel or search holds); a study's synthesis reader whose every claim quotes a page.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"robots-parser": "3.0.1",
|
|
50
50
|
"unpdf": "1.8.1",
|
|
51
51
|
"zod": "4.6.5",
|
|
52
|
-
"@wrenautomation/models": "0.36.
|
|
52
|
+
"@wrenautomation/models": "0.36.3"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"typecheck": "tsc --noEmit",
|