@wrenautomation/models 0.37.0 → 0.39.0
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/README.md +1 -0
- package/dist/batch.d.ts +58 -0
- package/dist/batch.js +149 -0
- package/dist/batch.js.map +1 -0
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ a new price goes here, never in the caller. No guard enforces this; this file an
|
|
|
16
16
|
| `@wrenautomation/models/command` | a shell command as a model (`commandModel`), Claude Code on the subscription (`claudeCode`) | Node |
|
|
17
17
|
| `@wrenautomation/models/spec` | a model from a setting string: `modelFromSpec("anthropic:sonnet", env)` | Node |
|
|
18
18
|
| `@wrenautomation/models/judge` | a judge: typed questions (`noul` yes or no, `choice`, `score`) answered with each label's probability, no text; `jevJudge` (TypeSafe's Jev, `TYPESAFE_API_KEY`; Laya with `TYPESAFE_BASE_URL`), `judgeFromSpec("jev", env)`, `fakeJudge`, `judgeFailure`, `top`. A hint or a router, never the final call | Node, Workers |
|
|
19
|
+
| `@wrenautomation/models/batch` | calls nobody waits on: `anthropicBatch({key, model})` → `batch(items)` gives a batch id, `batchResults(id)` says running or gives each item's reply. Anthropic Message Batches: half price, answers within 24 h. The caller keeps the id and parses each reply | Node |
|
|
19
20
|
|
|
20
21
|
## Use
|
|
21
22
|
|
package/dist/batch.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Batch calls: Anthropic Message Batches, half the list price, answers within 24 h. For judgments
|
|
3
|
+
* nobody waits on (nightly scores, labels, a backfill); a waited-on call stays `Model.complete`.
|
|
4
|
+
* `batch` sends and returns the batch id; `batchResults` reads it, answers once it has ended.
|
|
5
|
+
* The caller keeps the id (a batch outlives the process) and parses each reply (`parseAnswer`).
|
|
6
|
+
*/
|
|
7
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
8
|
+
import type { MessageCreateParamsNonStreaming } from "@anthropic-ai/sdk/resources/messages/messages";
|
|
9
|
+
import type { Reply, Request } from "./types.js";
|
|
10
|
+
/** One call in a batch; `id` comes back on its answer (1-64 chars: letters, digits, `_`, `-`). */
|
|
11
|
+
export interface BatchItem {
|
|
12
|
+
id: string;
|
|
13
|
+
request: Request | string;
|
|
14
|
+
}
|
|
15
|
+
export interface BatchAnswer {
|
|
16
|
+
id: string;
|
|
17
|
+
/** Absent when the call failed; `error` says why. */
|
|
18
|
+
reply?: Reply;
|
|
19
|
+
error?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface BatchCounts {
|
|
22
|
+
running: number;
|
|
23
|
+
ok: number;
|
|
24
|
+
failed: number;
|
|
25
|
+
}
|
|
26
|
+
export type BatchStatus = {
|
|
27
|
+
id: string;
|
|
28
|
+
state: "running";
|
|
29
|
+
counts: BatchCounts;
|
|
30
|
+
} | {
|
|
31
|
+
id: string;
|
|
32
|
+
state: "ended";
|
|
33
|
+
counts: BatchCounts;
|
|
34
|
+
answers: BatchAnswer[];
|
|
35
|
+
};
|
|
36
|
+
export interface Batcher {
|
|
37
|
+
/** As `Model.id`: the answering model. */
|
|
38
|
+
readonly id: string;
|
|
39
|
+
readonly provider: string;
|
|
40
|
+
batch(items: readonly BatchItem[]): Promise<{
|
|
41
|
+
id: string;
|
|
42
|
+
}>;
|
|
43
|
+
batchResults(id: string): Promise<BatchStatus>;
|
|
44
|
+
}
|
|
45
|
+
/** The SDK's batch calls; a test passes its own. */
|
|
46
|
+
export type BatchWire = Pick<Anthropic["messages"]["batches"], "create" | "retrieve" | "results">;
|
|
47
|
+
/** Anthropic's batch discount on every token, cache reads and writes included. */
|
|
48
|
+
export declare const BATCH_SHARE = 0.5;
|
|
49
|
+
/** A `Request` as Messages API params: the system carries a cache breakpoint, as on one call. */
|
|
50
|
+
export declare function batchParams(model: string, req: Request): MessageCreateParamsNonStreaming;
|
|
51
|
+
/** Claude through Message Batches on one key: a batch lives under the key's org. */
|
|
52
|
+
export declare function anthropicBatch(o: {
|
|
53
|
+
key: string;
|
|
54
|
+
/** A model id or a short name; default Haiku. */
|
|
55
|
+
model?: string;
|
|
56
|
+
wire?: BatchWire;
|
|
57
|
+
fetch?: typeof fetch;
|
|
58
|
+
}): Batcher;
|
package/dist/batch.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Batch calls: Anthropic Message Batches, half the list price, answers within 24 h. For judgments
|
|
3
|
+
* nobody waits on (nightly scores, labels, a backfill); a waited-on call stays `Model.complete`.
|
|
4
|
+
* `batch` sends and returns the batch id; `batchResults` reads it, answers once it has ended.
|
|
5
|
+
* The caller keeps the id (a batch outlives the process) and parses each reply (`parseAnswer`).
|
|
6
|
+
*/
|
|
7
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
8
|
+
import { Unsupported } from "./errors.js";
|
|
9
|
+
import { asRequest, checkParts } from "./model.js";
|
|
10
|
+
import { wellFormed } from "./parse.js";
|
|
11
|
+
import { priced } from "./prices.js";
|
|
12
|
+
import { anthropicModelId } from "./providers.js";
|
|
13
|
+
import { DEFAULT_MAX_TOKENS } from "./sdk.js";
|
|
14
|
+
/** Anthropic's batch discount on every token, cache reads and writes included. */
|
|
15
|
+
export const BATCH_SHARE = 0.5;
|
|
16
|
+
const FLOOR_TOKENS = 2048;
|
|
17
|
+
const TAKES = new Set(["text", "image", "pdf"]);
|
|
18
|
+
const ITEM_ID = /^[\w-]{1,64}$/;
|
|
19
|
+
const base64 = (d) => d instanceof Uint8Array ? Buffer.from(d).toString("base64") : String(d);
|
|
20
|
+
const isUrl = (d) => d instanceof URL || /^https?:\/\//.test(String(d));
|
|
21
|
+
function block(p) {
|
|
22
|
+
switch (p.type) {
|
|
23
|
+
case "text":
|
|
24
|
+
return { type: "text", text: wellFormed(p.text) };
|
|
25
|
+
case "image":
|
|
26
|
+
return isUrl(p.data)
|
|
27
|
+
? { type: "image", source: { type: "url", url: String(p.data) } }
|
|
28
|
+
: {
|
|
29
|
+
type: "image",
|
|
30
|
+
source: {
|
|
31
|
+
type: "base64",
|
|
32
|
+
media_type: p.mediaType,
|
|
33
|
+
data: base64(p.data),
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
case "pdf":
|
|
37
|
+
return isUrl(p.data)
|
|
38
|
+
? { type: "document", source: { type: "url", url: String(p.data) } }
|
|
39
|
+
: {
|
|
40
|
+
type: "document",
|
|
41
|
+
source: { type: "base64", media_type: "application/pdf", data: base64(p.data) },
|
|
42
|
+
};
|
|
43
|
+
default:
|
|
44
|
+
throw new Unsupported("batch", p.type);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** A `Request` as Messages API params: the system carries a cache breakpoint, as on one call. */
|
|
48
|
+
export function batchParams(model, req) {
|
|
49
|
+
checkParts(model, TAKES, req.prompt);
|
|
50
|
+
return {
|
|
51
|
+
model,
|
|
52
|
+
max_tokens: Math.max(req.maxTokens ?? DEFAULT_MAX_TOKENS, FLOOR_TOKENS),
|
|
53
|
+
...(req.system
|
|
54
|
+
? {
|
|
55
|
+
system: [
|
|
56
|
+
{ type: "text", text: wellFormed(req.system), cache_control: { type: "ephemeral" } },
|
|
57
|
+
],
|
|
58
|
+
}
|
|
59
|
+
: {}),
|
|
60
|
+
messages: [
|
|
61
|
+
{
|
|
62
|
+
role: "user",
|
|
63
|
+
content: typeof req.prompt === "string" ? wellFormed(req.prompt) : req.prompt.map(block),
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
...(req.effort ? { output_config: { effort: req.effort } } : {}),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** Claude through Message Batches on one key: a batch lives under the key's org. */
|
|
70
|
+
export function anthropicBatch(o) {
|
|
71
|
+
const model = anthropicModelId(o.model ?? "haiku");
|
|
72
|
+
const wire = o.wire ??
|
|
73
|
+
new Anthropic({ apiKey: o.key, maxRetries: 2, ...(o.fetch ? { fetch: o.fetch } : {}) }).messages
|
|
74
|
+
.batches;
|
|
75
|
+
return {
|
|
76
|
+
id: model,
|
|
77
|
+
provider: "anthropic",
|
|
78
|
+
async batch(items) {
|
|
79
|
+
if (!items.length)
|
|
80
|
+
throw new Error("batch: no items");
|
|
81
|
+
const seen = new Set();
|
|
82
|
+
for (const i of items) {
|
|
83
|
+
if (!ITEM_ID.test(i.id))
|
|
84
|
+
throw new Error(`batch: bad item id ${JSON.stringify(i.id)}`);
|
|
85
|
+
if (seen.has(i.id))
|
|
86
|
+
throw new Error(`batch: item id ${i.id} twice`);
|
|
87
|
+
seen.add(i.id);
|
|
88
|
+
}
|
|
89
|
+
const b = await wire.create({
|
|
90
|
+
requests: items.map((i) => ({
|
|
91
|
+
custom_id: i.id,
|
|
92
|
+
params: batchParams(model, asRequest(i.request)),
|
|
93
|
+
})),
|
|
94
|
+
});
|
|
95
|
+
return { id: b.id };
|
|
96
|
+
},
|
|
97
|
+
async batchResults(id) {
|
|
98
|
+
const b = await wire.retrieve(id);
|
|
99
|
+
const c = b.request_counts;
|
|
100
|
+
const counts = {
|
|
101
|
+
running: c.processing,
|
|
102
|
+
ok: c.succeeded,
|
|
103
|
+
failed: c.errored + c.canceled + c.expired,
|
|
104
|
+
};
|
|
105
|
+
if (b.processing_status !== "ended")
|
|
106
|
+
return { id, state: "running", counts };
|
|
107
|
+
const ms = b.ended_at ? Date.parse(b.ended_at) - Date.parse(b.created_at) : 0;
|
|
108
|
+
const answers = [];
|
|
109
|
+
for await (const r of await wire.results(id)) {
|
|
110
|
+
const res = r.result;
|
|
111
|
+
if (res.type !== "succeeded") {
|
|
112
|
+
answers.push({
|
|
113
|
+
id: r.custom_id,
|
|
114
|
+
error: res.type === "errored"
|
|
115
|
+
? `${res.error.error.type}: ${res.error.error.message}`.slice(0, 300)
|
|
116
|
+
: res.type,
|
|
117
|
+
});
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const m = res.message;
|
|
121
|
+
const u = m.usage;
|
|
122
|
+
const cacheRead = u.cache_read_input_tokens ?? 0;
|
|
123
|
+
const cacheWrite = u.cache_creation_input_tokens ?? 0;
|
|
124
|
+
const tokens = {
|
|
125
|
+
input: u.input_tokens + cacheRead + cacheWrite,
|
|
126
|
+
output: u.output_tokens,
|
|
127
|
+
...(cacheRead ? { cacheRead } : {}),
|
|
128
|
+
...(cacheWrite ? { cacheWrite } : {}),
|
|
129
|
+
};
|
|
130
|
+
const usage = priced(model, tokens);
|
|
131
|
+
if (usage.usd !== undefined)
|
|
132
|
+
usage.usd *= BATCH_SHARE;
|
|
133
|
+
answers.push({
|
|
134
|
+
id: r.custom_id,
|
|
135
|
+
reply: {
|
|
136
|
+
text: m.content.flatMap((x) => (x.type === "text" ? [x.text] : [])).join(""),
|
|
137
|
+
usage,
|
|
138
|
+
model: m.model,
|
|
139
|
+
stop: m.stop_reason ?? undefined,
|
|
140
|
+
ms,
|
|
141
|
+
raw: { batch: id, message: m.id },
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return { id, state: "ended", counts, answers };
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=batch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch.js","sourceRoot":"","sources":["../src/batch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAK1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAqC9C,kFAAkF;AAClF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC;AAC/B,MAAM,YAAY,GAAG,IAAI,CAAC;AA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AAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;wBAC5E,KAAK;wBACL,KAAK,EAAE,CAAC,CAAC,KAAK;wBACd,IAAI,EAAE,CAAC,CAAC,WAAW,IAAI,SAAS;wBAChC,EAAE;wBACF,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;qBAClC;iBACF,CAAC,CAAC;YACL,CAAC;YACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QACjD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrenautomation/models",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "One door to every model: a Model takes text, image, video, audio and PDF parts, answers with text, tokens and USD, and parses an answer to a zod shape. Adapters for Anthropic, Gemini, Cohere, any OpenAI-compatible server and a shell command (claude -p); ears for speech to text; a judge (Jev) for typed yes, no, pick and score answers; one price table; one key ring.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,6 +42,10 @@
|
|
|
42
42
|
"./judge": {
|
|
43
43
|
"types": "./dist/judge.d.ts",
|
|
44
44
|
"import": "./dist/judge.js"
|
|
45
|
+
},
|
|
46
|
+
"./batch": {
|
|
47
|
+
"types": "./dist/batch.d.ts",
|
|
48
|
+
"import": "./dist/batch.js"
|
|
45
49
|
}
|
|
46
50
|
},
|
|
47
51
|
"engines": {
|
|
@@ -52,6 +56,7 @@
|
|
|
52
56
|
"@ai-sdk/cohere": "4.0.71",
|
|
53
57
|
"@ai-sdk/google": "4.0.107",
|
|
54
58
|
"@ai-sdk/openai-compatible": "3.0.80",
|
|
59
|
+
"@anthropic-ai/sdk": "1.3.0",
|
|
55
60
|
"@typesafe-ai/sdk": "0.6.0",
|
|
56
61
|
"ai": "7.0.155",
|
|
57
62
|
"zod": "4.6.5"
|