@librechat/agents 4.0.1 → 4.0.2
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/cjs/decisions/deadline.cjs +52 -0
- package/dist/cjs/decisions/deadline.cjs.map +1 -0
- package/dist/cjs/decisions/dialect.cjs +88 -0
- package/dist/cjs/decisions/dialect.cjs.map +1 -0
- package/dist/cjs/decisions/http.cjs +77 -0
- package/dist/cjs/decisions/http.cjs.map +1 -0
- package/dist/cjs/decisions/index.cjs +7 -0
- package/dist/cjs/decisions/presets.cjs +82 -0
- package/dist/cjs/decisions/presets.cjs.map +1 -0
- package/dist/cjs/decisions/questions.cjs +70 -0
- package/dist/cjs/decisions/questions.cjs.map +1 -0
- package/dist/cjs/decisions/structuredChat.cjs +178 -0
- package/dist/cjs/decisions/structuredChat.cjs.map +1 -0
- package/dist/cjs/decisions/traceMarker.cjs +6 -0
- package/dist/cjs/decisions/traceMarker.cjs.map +1 -0
- package/dist/cjs/decisions/transport.cjs +166 -0
- package/dist/cjs/decisions/transport.cjs.map +1 -0
- package/dist/cjs/decisions/types.cjs +44 -0
- package/dist/cjs/decisions/types.cjs.map +1 -0
- package/dist/cjs/graphs/Graph.cjs +4 -1
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/langfuseToolOutputTracing.cjs +6 -1
- package/dist/cjs/langfuseToolOutputTracing.cjs.map +1 -1
- package/dist/cjs/main.cjs +39 -0
- package/dist/cjs/rerank/index.cjs +2 -0
- package/dist/cjs/rerank/search.cjs +45 -0
- package/dist/cjs/rerank/search.cjs.map +1 -0
- package/dist/cjs/rerank/systemone.cjs +70 -0
- package/dist/cjs/rerank/systemone.cjs.map +1 -0
- package/dist/cjs/run.cjs +4 -0
- package/dist/cjs/run.cjs.map +1 -1
- package/dist/cjs/tools/search/rerankers.cjs +1 -0
- package/dist/cjs/tools/search/search.cjs +3 -3
- package/dist/cjs/tools/search/search.cjs.map +1 -1
- package/dist/cjs/tools/search/tool.cjs +4 -3
- package/dist/cjs/tools/search/tool.cjs.map +1 -1
- package/dist/cjs/tools/subagent/SubagentExecutionRegistry.cjs +11 -0
- package/dist/cjs/tools/subagent/SubagentExecutionRegistry.cjs.map +1 -1
- package/dist/cjs/tools/subagent/SubagentExecutor.cjs +87 -14
- package/dist/cjs/tools/subagent/SubagentExecutor.cjs.map +1 -1
- package/dist/cjs/tools/subagent/diagnostics.cjs +45 -2
- package/dist/cjs/tools/subagent/diagnostics.cjs.map +1 -1
- package/dist/cjs/tools/subagent/index.cjs +1 -0
- package/dist/esm/decisions/deadline.mjs +52 -0
- package/dist/esm/decisions/deadline.mjs.map +1 -0
- package/dist/esm/decisions/dialect.mjs +87 -0
- package/dist/esm/decisions/dialect.mjs.map +1 -0
- package/dist/esm/decisions/http.mjs +75 -0
- package/dist/esm/decisions/http.mjs.map +1 -0
- package/dist/esm/decisions/index.mjs +8 -0
- package/dist/esm/decisions/presets.mjs +77 -0
- package/dist/esm/decisions/presets.mjs.map +1 -0
- package/dist/esm/decisions/questions.mjs +67 -0
- package/dist/esm/decisions/questions.mjs.map +1 -0
- package/dist/esm/decisions/structuredChat.mjs +178 -0
- package/dist/esm/decisions/structuredChat.mjs.map +1 -0
- package/dist/esm/decisions/traceMarker.mjs +6 -0
- package/dist/esm/decisions/traceMarker.mjs.map +1 -0
- package/dist/esm/decisions/transport.mjs +164 -0
- package/dist/esm/decisions/transport.mjs.map +1 -0
- package/dist/esm/decisions/types.mjs +39 -0
- package/dist/esm/decisions/types.mjs.map +1 -0
- package/dist/esm/graphs/Graph.mjs +4 -1
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/langfuseToolOutputTracing.mjs +6 -1
- package/dist/esm/langfuseToolOutputTracing.mjs.map +1 -1
- package/dist/esm/main.mjs +13 -1
- package/dist/esm/rerank/index.mjs +3 -0
- package/dist/esm/rerank/search.mjs +45 -0
- package/dist/esm/rerank/search.mjs.map +1 -0
- package/dist/esm/rerank/systemone.mjs +70 -0
- package/dist/esm/rerank/systemone.mjs.map +1 -0
- package/dist/esm/run.mjs +4 -0
- package/dist/esm/run.mjs.map +1 -1
- package/dist/esm/tools/search/rerankers.mjs +1 -1
- package/dist/esm/tools/search/search.mjs +3 -3
- package/dist/esm/tools/search/search.mjs.map +1 -1
- package/dist/esm/tools/search/tool.mjs +4 -3
- package/dist/esm/tools/search/tool.mjs.map +1 -1
- package/dist/esm/tools/subagent/SubagentExecutionRegistry.mjs +11 -0
- package/dist/esm/tools/subagent/SubagentExecutionRegistry.mjs.map +1 -1
- package/dist/esm/tools/subagent/SubagentExecutor.mjs +88 -15
- package/dist/esm/tools/subagent/SubagentExecutor.mjs.map +1 -1
- package/dist/esm/tools/subagent/diagnostics.mjs +44 -3
- package/dist/esm/tools/subagent/diagnostics.mjs.map +1 -1
- package/dist/esm/tools/subagent/index.mjs +1 -0
- package/dist/types/decisions/deadline.d.ts +3 -0
- package/dist/types/decisions/dialect.d.ts +11 -0
- package/dist/types/decisions/http.d.ts +22 -0
- package/dist/types/decisions/index.d.ts +10 -0
- package/dist/types/decisions/presets.d.ts +17 -0
- package/dist/types/decisions/questions.d.ts +8 -0
- package/dist/types/decisions/structuredChat.d.ts +16 -0
- package/dist/types/decisions/traceMarker.d.ts +2 -0
- package/dist/types/decisions/transport.d.ts +29 -0
- package/dist/types/decisions/types.d.ts +119 -0
- package/dist/types/graphs/Graph.d.ts +2 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/rerank/index.d.ts +4 -0
- package/dist/types/rerank/search.d.ts +7 -0
- package/dist/types/rerank/systemone.d.ts +13 -0
- package/dist/types/rerank/types.d.ts +24 -0
- package/dist/types/run.d.ts +1 -0
- package/dist/types/tools/search/types.d.ts +3 -1
- package/dist/types/tools/subagent/SubagentExecutionRegistry.d.ts +4 -0
- package/dist/types/tools/subagent/SubagentExecutor.d.ts +13 -0
- package/dist/types/tools/subagent/diagnostics.d.ts +32 -8
- package/dist/types/tools/subagent/index.d.ts +2 -0
- package/dist/types/types/graph.d.ts +3 -0
- package/dist/types/types/run.d.ts +2 -0
- package/package.json +1 -1
- package/src/decisions/deadline.ts +92 -0
- package/src/decisions/dialect.ts +200 -0
- package/src/decisions/http.ts +175 -0
- package/src/decisions/index.ts +14 -0
- package/src/decisions/presets.ts +111 -0
- package/src/decisions/questions.ts +128 -0
- package/src/decisions/structuredChat.ts +364 -0
- package/src/decisions/traceMarker.ts +2 -0
- package/src/decisions/transport.ts +335 -0
- package/src/decisions/types.ts +193 -0
- package/src/graphs/Graph.ts +4 -0
- package/src/index.ts +2 -0
- package/src/langfuseToolOutputTracing.ts +8 -1
- package/src/rerank/index.ts +4 -0
- package/src/rerank/search.ts +85 -0
- package/src/rerank/systemone.ts +140 -0
- package/src/rerank/types.ts +28 -0
- package/src/run.ts +4 -0
- package/src/tools/search/search.ts +4 -4
- package/src/tools/search/tool.ts +27 -25
- package/src/tools/search/types.ts +4 -1
- package/src/tools/subagent/SubagentExecutionRegistry.ts +21 -0
- package/src/tools/subagent/SubagentExecutor.ts +190 -22
- package/src/tools/subagent/diagnostics.ts +88 -9
- package/src/tools/subagent/index.ts +11 -0
- package/src/types/graph.ts +3 -0
- package/src/types/run.ts +2 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const require_types = require("./types.cjs");
|
|
2
|
+
//#region src/decisions/deadline.ts
|
|
3
|
+
async function withDecisionDeadline(provider, timeoutMs, callerSignal, operation) {
|
|
4
|
+
if (!Number.isSafeInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > 36e5) throw new require_types.DecisionError("bad_request", "invalid decision model timeout", { provider });
|
|
5
|
+
if (callerSignal?.aborted === true) throw new require_types.DecisionError("aborted", "caller aborted the request", { provider });
|
|
6
|
+
const expiresAt = performance.now() + timeoutMs;
|
|
7
|
+
const deadline = new AbortController();
|
|
8
|
+
const signal = callerSignal ? AbortSignal.any([callerSignal, deadline.signal]) : deadline.signal;
|
|
9
|
+
const timer = setTimeout(() => deadline.abort(), timeoutMs);
|
|
10
|
+
const expired = () => {
|
|
11
|
+
if (performance.now() >= expiresAt) deadline.abort();
|
|
12
|
+
return signal.aborted;
|
|
13
|
+
};
|
|
14
|
+
const abortError = () => {
|
|
15
|
+
if (callerSignal?.aborted === true) return new require_types.DecisionError("aborted", "caller aborted the request", { provider });
|
|
16
|
+
return new require_types.DecisionError("timeout", "decision model deadline exceeded", { provider });
|
|
17
|
+
};
|
|
18
|
+
const waitFor = (task) => new Promise((resolve, reject) => {
|
|
19
|
+
if (expired()) {
|
|
20
|
+
task.catch(() => {});
|
|
21
|
+
reject(abortError());
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const onAbort = () => {
|
|
25
|
+
signal.removeEventListener("abort", onAbort);
|
|
26
|
+
reject(abortError());
|
|
27
|
+
};
|
|
28
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
29
|
+
if (expired()) onAbort();
|
|
30
|
+
task.then((value) => {
|
|
31
|
+
signal.removeEventListener("abort", onAbort);
|
|
32
|
+
if (expired()) reject(abortError());
|
|
33
|
+
else resolve(value);
|
|
34
|
+
}, (error) => {
|
|
35
|
+
signal.removeEventListener("abort", onAbort);
|
|
36
|
+
reject(expired() ? abortError() : error);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
try {
|
|
40
|
+
return await waitFor(operation(signal, waitFor));
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (expired()) throw abortError();
|
|
43
|
+
throw error;
|
|
44
|
+
} finally {
|
|
45
|
+
expired();
|
|
46
|
+
clearTimeout(timer);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.withDecisionDeadline = withDecisionDeadline;
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=deadline.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deadline.cjs","names":["DecisionError"],"sources":["../../../src/decisions/deadline.ts"],"mappings":";;AAKA,eAAsB,qBACpB,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,CACF;CACF,CAAC;CAEH,IAAI;EACF,OAAO,MAAM,QAAQ,UAAU,QAAQ,OAAO,CAAC;CACjD,SAAS,OAAO;EACd,IAAI,QAAQ,GACV,MAAM,WAAW;EAEnB,MAAM;CACR,UAAU;EACR,QAAQ;EACR,aAAa,KAAK;CACpB;AACF"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const require_types = require("./types.cjs");
|
|
2
|
+
//#region src/decisions/dialect.ts
|
|
3
|
+
function toWireQuestion(question, dialect) {
|
|
4
|
+
const type = dialect === "systemone" && question.type === "boolean" ? "noul" : question.type;
|
|
5
|
+
if (question.criteria == null) return {
|
|
6
|
+
type,
|
|
7
|
+
instructions: question.instructions
|
|
8
|
+
};
|
|
9
|
+
const criteria = question.type === "boolean" && typeof question.criteria === "string" ? { true: question.criteria } : question.criteria;
|
|
10
|
+
return {
|
|
11
|
+
type,
|
|
12
|
+
instructions: question.instructions,
|
|
13
|
+
criteria
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function isProbability(value) {
|
|
17
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 1;
|
|
18
|
+
}
|
|
19
|
+
function probabilitiesOf(raw, answerType, question, selectedChoice) {
|
|
20
|
+
if (raw == null) return null;
|
|
21
|
+
if (!require_types.isDecisionObject(raw)) return;
|
|
22
|
+
const entries = Object.entries(raw);
|
|
23
|
+
if (entries.length === 0) return null;
|
|
24
|
+
if (question?.type === "choice" && entries.length !== Object.keys(question.criteria).length || question?.type === "score" && entries.length !== question.criteria.length) return;
|
|
25
|
+
const probabilities = Object.create(null);
|
|
26
|
+
let total = 0;
|
|
27
|
+
let maximum = 0;
|
|
28
|
+
for (const [key, value] of entries) {
|
|
29
|
+
if (!isProbability(value)) return;
|
|
30
|
+
if (question?.type === "choice" && !Object.hasOwn(question.criteria, key)) return;
|
|
31
|
+
if (answerType === "score" && (!/^(0|[1-9][0-9]*)$/.test(key) || Number(key) >= entries.length)) return;
|
|
32
|
+
probabilities[key] = value;
|
|
33
|
+
total += value;
|
|
34
|
+
maximum = Math.max(maximum, value);
|
|
35
|
+
}
|
|
36
|
+
if (selectedChoice !== void 0 && (!Object.hasOwn(probabilities, selectedChoice) || probabilities[selectedChoice] < maximum)) return;
|
|
37
|
+
const roundingTolerance = Math.min(.02, Math.max(.01, entries.length * 5e-5 + .001));
|
|
38
|
+
return Math.abs(total - 1) <= roundingTolerance ? probabilities : void 0;
|
|
39
|
+
}
|
|
40
|
+
function readAnswer(answer, dialect, question) {
|
|
41
|
+
if (!require_types.isDecisionObject(answer)) return null;
|
|
42
|
+
const record = answer;
|
|
43
|
+
const booleanType = dialect === "systemone" ? "noul" : "boolean";
|
|
44
|
+
const probability = dialect === "systemone" ? record.noul : record.probability;
|
|
45
|
+
if (record.type === booleanType) {
|
|
46
|
+
if (!isProbability(probability) || question != null && question.type !== "boolean") return null;
|
|
47
|
+
return {
|
|
48
|
+
type: "boolean",
|
|
49
|
+
probability
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (record.type !== "choice" && record.type !== "score") return null;
|
|
53
|
+
const confidence = record.confidence;
|
|
54
|
+
if (confidence != null && !isProbability(confidence)) return null;
|
|
55
|
+
const probabilities = probabilitiesOf(record.probabilities, record.type, question, record.type === "choice" && typeof record.choice === "string" ? record.choice : void 0);
|
|
56
|
+
if (probabilities === void 0) return null;
|
|
57
|
+
if (record.type === "choice") {
|
|
58
|
+
if (typeof record.choice !== "string" || question != null && (question.type !== "choice" || !Object.hasOwn(question.criteria, record.choice))) return null;
|
|
59
|
+
return {
|
|
60
|
+
type: "choice",
|
|
61
|
+
choice: record.choice,
|
|
62
|
+
confidence: confidence ?? null,
|
|
63
|
+
probabilities
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (typeof record.score !== "number" || !Number.isFinite(record.score) || record.score < 0 || question != null && (question.type !== "score" || record.score > question.criteria.length - 1)) return null;
|
|
67
|
+
if (probabilities !== null) {
|
|
68
|
+
let weightedScore = 0;
|
|
69
|
+
let levels = 0;
|
|
70
|
+
for (const [level, probability] of Object.entries(probabilities)) {
|
|
71
|
+
weightedScore += Number(level) * probability;
|
|
72
|
+
levels += 1;
|
|
73
|
+
}
|
|
74
|
+
const roundingTolerance = Math.min(.02, 5e-5 * (1 + levels * (levels - 1) / 2) + .001);
|
|
75
|
+
if (!Number.isFinite(weightedScore) || Math.abs(record.score - weightedScore) > roundingTolerance) return null;
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
type: "score",
|
|
79
|
+
score: record.score,
|
|
80
|
+
confidence: confidence ?? null,
|
|
81
|
+
probabilities
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
exports.readAnswer = readAnswer;
|
|
86
|
+
exports.toWireQuestion = toWireQuestion;
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=dialect.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialect.cjs","names":["isDecisionObject"],"sources":["../../../src/decisions/dialect.ts"],"mappings":";;AAwBA,SAAgB,eACd,UACA,SACc;CACd,MAAM,OACJ,YAAY,eAAe,SAAS,SAAS,YACzC,SACA,SAAS;CACf,IAAI,SAAS,YAAY,MACvB,OAAO;EAAE;EAAM,cAAc,SAAS;CAAa;CAErD,MAAM,WACJ,SAAS,SAAS,aAAa,OAAO,SAAS,aAAa,WACxD,EAAE,MAAM,SAAS,SAAS,IAC1B,SAAS;CACf,OAAO;EAAE;EAAM,cAAc,SAAS;EAAc;CAAS;AAC/D;AAEA,SAAS,cAAc,OAAiC;CACtD,OACE,OAAO,UAAU,YACjB,OAAO,SAAS,KAAK,KACrB,SAAS,KACT,SAAS;AAEb;AAGA,SAAS,gBACP,KACA,YACA,UACA,gBAC2C;CAC3C,IAAI,OAAO,MACT,OAAO;CAET,IAAI,CAACA,cAAAA,iBAAiB,GAAG,GACvB;CAEF,MAAM,UAAU,OAAO,QAAQ,GAAG;CAClC,IAAI,QA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cAAc,UAAU,GACjD,OAAO;CAET,MAAM,gBAAgB,gBACpB,OAAO,eACP,OAAO,MACP,UACA,OAAO,SAAS,YAAY,OAAO,OAAO,WAAW,WACjD,OAAO,SACP,KAAA,CACN;CACA,IAAI,kBAAkB,KAAA,GACpB,OAAO;CAET,IAAI,OAAO,SAAS,UAAU;EAC5B,IACE,OAAO,OAAO,WAAW,YACxB,YAAY,SACV,SAAS,SAAS,YACjB,CAAC,OAAO,OAAO,SAAS,UAAU,OAAO,MAAM,IAEnD,OAAO;EAET,OAAO;GACL,MAAM;GACN,QAAQ,OAAO;GACf,YAAY,cAAc;GAC1B;EACF;CACF;CACA,IACE,OAAO,OAAO,UAAU,YACxB,CAAC,OAAO,SAAS,OAAO,KAAK,KAC7B,OAAO,QAAQ,KACd,YAAY,SACV,SAAS,SAAS,WACjB,OAAO,QAAQ,SAAS,SAAS,SAAS,IAE9C,OAAO;CAET,IAAI,kBAAkB,MAAM;EAC1B,IAAI,gBAAgB;EACpB,IAAI,SAAS;EACb,KAAK,MAAM,CAAC,OAAO,gBAAgB,OAAO,QAAQ,aAAa,GAAG;GAChE,iBAAiB,OAAO,KAAK,IAAI;GACjC,UAAU;EACZ;EACA,MAAM,oBAAoB,KAAK,IAC7B,KACA,QAAW,IAAK,UAAU,SAAS,KAAM,KAAK,IAChD;EACA,IACE,CAAC,OAAO,SAAS,aAAa,KAC9B,KAAK,IAAI,OAAO,QAAQ,aAAa,IAAI,mBAEzC,OAAO;CAEX;CACA,OAAO;EACL,MAAM;EACN,OAAO,OAAO;EACd,YAAY,cAAc;EAC1B;CACF;AACF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const require_types = require("./types.cjs");
|
|
2
|
+
const require_questions = require("./questions.cjs");
|
|
3
|
+
const require_dialect = require("./dialect.cjs");
|
|
4
|
+
const require_transport = require("./transport.cjs");
|
|
5
|
+
//#region src/decisions/http.ts
|
|
6
|
+
const HTTP_PROVIDER_ID = "http";
|
|
7
|
+
function parseEnvelope(body, providerId, readOne, responseKey, expected) {
|
|
8
|
+
let parsed;
|
|
9
|
+
try {
|
|
10
|
+
parsed = JSON.parse(body);
|
|
11
|
+
} catch {
|
|
12
|
+
throw new require_types.DecisionError("malformed_response", "response was not JSON", { provider: providerId });
|
|
13
|
+
}
|
|
14
|
+
if (!require_types.isDecisionObject(parsed)) throw new require_types.DecisionError("malformed_response", "response was not an object", { provider: providerId });
|
|
15
|
+
const unwrapped = responseKey != null && responseKey !== "" ? parsed[responseKey] : parsed;
|
|
16
|
+
if (!require_types.isDecisionObject(unwrapped) || !require_types.isDecisionObject(unwrapped.answers) || Object.keys(unwrapped.answers).length === 0) throw new require_types.DecisionError("malformed_response", "response carried no answers", { provider: providerId });
|
|
17
|
+
const answers = Object.create(null);
|
|
18
|
+
for (const [id, answer] of Object.entries(unwrapped.answers)) {
|
|
19
|
+
if (expected && !Object.hasOwn(expected, id)) throw new require_types.DecisionError("malformed_response", "response carried an unknown answer", { provider: providerId });
|
|
20
|
+
const mapped = readOne(answer, expected?.[id]);
|
|
21
|
+
if (!mapped) throw new require_types.DecisionError("malformed_response", "response carried an invalid answer", { provider: providerId });
|
|
22
|
+
answers[id] = mapped;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
model: typeof unwrapped.model === "string" ? unwrapped.model : "unknown",
|
|
26
|
+
answers,
|
|
27
|
+
usage: require_types.readDecisionUsage(unwrapped.usage)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function createHttpDecisionModel(options) {
|
|
31
|
+
const providerId = options.providerId ?? "http";
|
|
32
|
+
const send = require_transport.createTransport({
|
|
33
|
+
...options,
|
|
34
|
+
providerId
|
|
35
|
+
});
|
|
36
|
+
const model = options.model ?? "";
|
|
37
|
+
const dialect = options.dialect ?? "port";
|
|
38
|
+
const { requestKey, responseKey } = options;
|
|
39
|
+
return {
|
|
40
|
+
id: providerId,
|
|
41
|
+
model,
|
|
42
|
+
async decide(request) {
|
|
43
|
+
return send(() => {
|
|
44
|
+
const entries = require_questions.validateDecisionQuestions(request.questions, providerId);
|
|
45
|
+
const questions = Object.create(null);
|
|
46
|
+
const expected = Object.create(null);
|
|
47
|
+
for (const [id, question] of entries) {
|
|
48
|
+
questions[id] = require_dialect.toWireQuestion(question, dialect);
|
|
49
|
+
expected[id] = question;
|
|
50
|
+
}
|
|
51
|
+
const inner = {
|
|
52
|
+
state: request.state,
|
|
53
|
+
questions
|
|
54
|
+
};
|
|
55
|
+
let payload;
|
|
56
|
+
try {
|
|
57
|
+
payload = JSON.stringify({
|
|
58
|
+
...model !== "" ? { model } : {},
|
|
59
|
+
...requestKey != null && requestKey !== "" ? { [requestKey]: inner } : inner
|
|
60
|
+
});
|
|
61
|
+
} catch {
|
|
62
|
+
throw new require_types.DecisionError("bad_request", "invalid decision model request", { provider: providerId });
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
payload,
|
|
66
|
+
parse: (body) => parseEnvelope(body, providerId, (answer, question) => require_dialect.readAnswer(answer, dialect, question), responseKey, expected)
|
|
67
|
+
};
|
|
68
|
+
}, request.signal, request.label ?? "decide", request.timeoutMs);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
exports.HTTP_PROVIDER_ID = HTTP_PROVIDER_ID;
|
|
74
|
+
exports.createHttpDecisionModel = createHttpDecisionModel;
|
|
75
|
+
exports.parseEnvelope = parseEnvelope;
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=http.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.cjs","names":["DecisionError","isDecisionObject","readDecisionUsage","createTransport","validateDecisionQuestions","toWireQuestion","readAnswer"],"sources":["../../../src/decisions/http.ts"],"mappings":";;;;;AAeA,MAAa,mBAAmB;AAmBhC,SAAgB,cACd,MACA,YACA,SAIA,aACA,UACgB;CAChB,IAAI;CACJ,IAAI;EACF,SAAS,KAAK,MAAM,IAAI;CAC1B,QA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UAAUC,kBAAAA,0BACd,QAAQ,WACR,UACF;IACA,MAAM,YAGF,OAAO,OAAO,IAAI;IACtB,MAAM,WACJ,OAAO,OAAO,IAAI;IACpB,KAAK,MAAM,CAAC,IAAI,aAAa,SAAS;KACpC,UAAU,MAAMC,gBAAAA,eAAe,UAAU,OAAO;KAChD,SAAS,MAAM;IACjB;IACA,MAAM,QAAQ;KAAE,OAAO,QAAQ;KAAO;IAAU;IAChD,IAAI;IACJ,IAAI;KACF,UAAU,KAAK,UAAU;MACvB,GAAI,UAAU,KAAK,EAAE,MAAM,IAAI,CAAC;MAChC,GAAI,cAAc,QAAQ,eAAe,KACrC,GAAG,aAAa,MAAM,IACtB;KACN,CAAC;IACH,QAAQ;KACN,MAAM,IAAIL,cAAAA,cACR,eACA,kCACA,EACE,UAAU,WACZ,CACF;IACF;IACA,OAAO;KACL;KACA,QAAQ,SACN,cACE,MACA,aACC,QAAQ,aAAaM,gBAAAA,WAAW,QAAQ,SAAS,QAAQ,GAC1D,aACA,QACF;IACJ;GACF,GACA,QAAQ,QACR,QAAQ,SAAS,UACjB,QAAQ,SACV;EACF;CACF;AACF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const require_http = require("./http.cjs");
|
|
2
|
+
//#region src/decisions/presets.ts
|
|
3
|
+
const DEFAULT_API_KEY_ENV = "DECISION_API_KEY";
|
|
4
|
+
const DECISION_PRESETS = Object.freeze({
|
|
5
|
+
http: Object.freeze({
|
|
6
|
+
dialect: "port",
|
|
7
|
+
requiresAuth: true,
|
|
8
|
+
apiKeyEnv: DEFAULT_API_KEY_ENV
|
|
9
|
+
}),
|
|
10
|
+
typesafe: Object.freeze({
|
|
11
|
+
baseURL: "https://api.typesafe.ai/v1/systemone",
|
|
12
|
+
model: "jev-latest",
|
|
13
|
+
dialect: "systemone",
|
|
14
|
+
requiresAuth: true,
|
|
15
|
+
apiKeyEnv: "TYPESAFE_API_KEY"
|
|
16
|
+
}),
|
|
17
|
+
laya: Object.freeze({
|
|
18
|
+
dialect: "systemone",
|
|
19
|
+
requiresAuth: false
|
|
20
|
+
}),
|
|
21
|
+
clickhouse: Object.freeze({
|
|
22
|
+
baseURL: "https://inference-internal.clickhouse.cloud/v1/systemone",
|
|
23
|
+
model: "jev-latest",
|
|
24
|
+
dialect: "systemone",
|
|
25
|
+
requiresAuth: true,
|
|
26
|
+
apiKeyEnv: "CHAI_AUTH_TOKEN"
|
|
27
|
+
}),
|
|
28
|
+
openrouter: Object.freeze({
|
|
29
|
+
baseURL: "https://openrouter.ai/api/alpha/decisions",
|
|
30
|
+
model: "~typesafe/jev-latest",
|
|
31
|
+
dialect: "systemone",
|
|
32
|
+
requiresAuth: true,
|
|
33
|
+
apiKeyEnv: "OPENROUTER_KEY"
|
|
34
|
+
}),
|
|
35
|
+
cloudflare: Object.freeze({
|
|
36
|
+
model: "typesafe/jev",
|
|
37
|
+
dialect: "systemone",
|
|
38
|
+
requestKey: "input",
|
|
39
|
+
responseKey: "result",
|
|
40
|
+
requiresAuth: true,
|
|
41
|
+
apiKeyEnv: "CLOUDFLARE_API_TOKEN"
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
function decisionPreset(name) {
|
|
45
|
+
if (name == null || name === "") return null;
|
|
46
|
+
return Object.hasOwn(DECISION_PRESETS, name) ? { ...DECISION_PRESETS[name] } : null;
|
|
47
|
+
}
|
|
48
|
+
function mergeDecisionSettings(preset, configured) {
|
|
49
|
+
return {
|
|
50
|
+
...preset ?? {},
|
|
51
|
+
...configured ?? {},
|
|
52
|
+
...preset?.requiresAuth === true ? { requiresAuth: true } : {}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function decisionProviderNames() {
|
|
56
|
+
return Object.keys(DECISION_PRESETS);
|
|
57
|
+
}
|
|
58
|
+
function createDecisionModel(settings, apiKey, options) {
|
|
59
|
+
return require_http.createHttpDecisionModel({
|
|
60
|
+
providerId: options?.providerId,
|
|
61
|
+
apiKey,
|
|
62
|
+
requiresAuth: settings.requiresAuth,
|
|
63
|
+
endpoint: settings.baseURL ?? "",
|
|
64
|
+
model: settings.model,
|
|
65
|
+
dialect: settings.dialect,
|
|
66
|
+
requestKey: settings.requestKey,
|
|
67
|
+
responseKey: settings.responseKey,
|
|
68
|
+
timeoutMs: settings.timeoutMs,
|
|
69
|
+
maxRetries: settings.maxRetries,
|
|
70
|
+
fetch: options?.fetch,
|
|
71
|
+
onAnswered: options?.onAnswered
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
exports.DECISION_PRESETS = DECISION_PRESETS;
|
|
76
|
+
exports.DEFAULT_API_KEY_ENV = DEFAULT_API_KEY_ENV;
|
|
77
|
+
exports.createDecisionModel = createDecisionModel;
|
|
78
|
+
exports.decisionPreset = decisionPreset;
|
|
79
|
+
exports.decisionProviderNames = decisionProviderNames;
|
|
80
|
+
exports.mergeDecisionSettings = mergeDecisionSettings;
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=presets.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.cjs","names":["createHttpDecisionModel"],"sources":["../../../src/decisions/presets.ts"],"mappings":";;AAQA,MAAa,sBAAsB;AAMnC,MAAa,mBAET,OAAO,OAAO;CAChB,MAAM,OAAO,OAAO;EAClB,SAAS;EACT,cAAc;EACd,WAAW;CACb,CAAC;CACD,UAAU,OAAO,OAAO;EACtB,SAAS;EACT,OAAO;EACP,SAAS;EACT,cAAc;EACd,WAAW;CACb,CAAC;CACD,MAAM,OAAO,OAAO;EAElB,SAAS;EACT,cAAc;CAChB,CAAC;CACD,YAAY,OAAO,OAAO;EAExB,SAAS;EACT,OAAO;EACP,SAAS;EACT,cAAc;EACd,WAAW;CACb,CAAC;CACD,YAAY,OAAO,OAAO;EACxB,SAAS;EACT,OAAO;EACP,SAAS;EACT,cAAc;EACd,WAAW;CACb,CAAC;CACD,YAAY,OAAO,OAAO;EAExB,OAAO;EACP,SAAS;EACT,YAAY;EACZ,aAAa;EACb,cAAc;EACd,WAAW;CACb,CAAC;AACH,CAAC;AAED,SAAgB,eACd,MACiC;CACjC,IAAI,QAAQ,QAAQ,SAAS,IAC3B,OAAO;CAET,OAAO,OAAO,OAAO,kBAAkB,IAAI,IACvC,EAAE,GAAG,iBAAiB,MAAM,IAC5B;AACN;AAGA,SAAgB,sBACd,QACA,YAC0B;CAC1B,OAAO;EACL,GAAI,UAAU,CAAC;EACf,GAAI,cAAc,CAAC;EACnB,GAAI,QAAQ,iBAAiB,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAChE;AACF;AAEA,SAAgB,wBAAkC;CAChD,OAAO,OAAO,KAAK,gBAAgB;AACrC;AAEA,SAAgB,oBACd,UACA,QACA,SAKe;CACf,OAAOA,aAAAA,wBAAwB;EAC7B,YAAY,SAAS;EACrB;EACA,cAAc,SAAS;EACvB,UAAU,SAAS,WAAW;EAC9B,OAAO,SAAS;EAChB,SAAS,SAAS;EAClB,YAAY,SAAS;EACrB,aAAa,SAAS;EACtB,WAAW,SAAS;EACpB,YAAY,SAAS;EACrB,OAAO,SAAS;EAChB,YAAY,SAAS;CACvB,CAAC;AACH"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const require_types = require("./types.cjs");
|
|
2
|
+
//#region src/decisions/questions.ts
|
|
3
|
+
function validQuestionId(id) {
|
|
4
|
+
if (id.length === 0 || id.length > 128) return false;
|
|
5
|
+
for (let index = 0; index < id.length; index++) if (id.charCodeAt(index) < 32) return false;
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
function validBooleanCriteria(criteria) {
|
|
9
|
+
if (criteria === void 0 || typeof criteria === "string") return true;
|
|
10
|
+
if (!require_types.isDecisionObject(criteria)) return false;
|
|
11
|
+
for (const [side, description] of Object.entries(criteria)) if (side !== "true" && side !== "false" || description !== void 0 && typeof description !== "string" && !Array.isArray(description) && !require_types.isDecisionObject(description)) return false;
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
function validateDecisionQuestions(questions, provider) {
|
|
15
|
+
if (!require_types.isDecisionObject(questions)) throw new require_types.DecisionError("bad_request", "invalid decision model questions", { provider });
|
|
16
|
+
const supplied = Object.entries(questions);
|
|
17
|
+
if (supplied.length === 0) throw new require_types.DecisionError("bad_request", "decision model requires questions", { provider });
|
|
18
|
+
const entries = [];
|
|
19
|
+
for (const [id, question] of supplied) {
|
|
20
|
+
if (!validQuestionId(id) || !require_types.isDecisionObject(question) || ![
|
|
21
|
+
"boolean",
|
|
22
|
+
"choice",
|
|
23
|
+
"score"
|
|
24
|
+
].includes(question.type) || question.type === "boolean" && !validBooleanCriteria(question.criteria) || question.type === "choice" && (!require_types.isDecisionObject(question.criteria) || Object.keys(question.criteria).length === 0) || question.type === "score" && (!Array.isArray(question.criteria) || question.criteria.length < 2)) throw new require_types.DecisionError("bad_request", "invalid decision model question", { provider });
|
|
25
|
+
if (question.type === "choice") entries.push([id, {
|
|
26
|
+
...question,
|
|
27
|
+
criteria: { ...question.criteria }
|
|
28
|
+
}]);
|
|
29
|
+
else if (question.type === "score") entries.push([id, {
|
|
30
|
+
...question,
|
|
31
|
+
criteria: [...question.criteria]
|
|
32
|
+
}]);
|
|
33
|
+
else entries.push([id, {
|
|
34
|
+
...question,
|
|
35
|
+
...require_types.isDecisionObject(question.criteria) ? { criteria: { ...question.criteria } } : {}
|
|
36
|
+
}]);
|
|
37
|
+
}
|
|
38
|
+
return entries;
|
|
39
|
+
}
|
|
40
|
+
function booleanQuestion(instructions, criteria) {
|
|
41
|
+
return criteria == null ? {
|
|
42
|
+
type: "boolean",
|
|
43
|
+
instructions
|
|
44
|
+
} : {
|
|
45
|
+
type: "boolean",
|
|
46
|
+
instructions,
|
|
47
|
+
criteria
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function choiceQuestion(instructions, criteria) {
|
|
51
|
+
return {
|
|
52
|
+
type: "choice",
|
|
53
|
+
instructions,
|
|
54
|
+
criteria
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function scoreQuestion(instructions, levels) {
|
|
58
|
+
return {
|
|
59
|
+
type: "score",
|
|
60
|
+
instructions,
|
|
61
|
+
criteria: levels
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
exports.booleanQuestion = booleanQuestion;
|
|
66
|
+
exports.choiceQuestion = choiceQuestion;
|
|
67
|
+
exports.scoreQuestion = scoreQuestion;
|
|
68
|
+
exports.validateDecisionQuestions = validateDecisionQuestions;
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=questions.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"questions.cjs","names":["isDecisionObject","DecisionError"],"sources":["../../../src/decisions/questions.ts"],"mappings":";;AAUA,SAAS,gBAAgB,IAAqB;CAC5C,IAAI,GAAG,WAAW,KAAK,GAAG,SAAS,KACjC,OAAO;CAET,KAAK,IAAI,QAAQ,GAAG,QAAQ,GAAG,QAAQ,SACrC,IAAI,GAAG,WAAW,KAAK,IAAI,IACzB,OAAO;CAGX,OAAO;AACT;AAEA,SAAS,qBAAqB,UAAgD;CAC5E,IAAI,aAAa,KAAA,KAAa,OAAO,aAAa,UAChD,OAAO;CAET,IAAI,CAACA,cAAAA,iBAAiB,QAAQ,GAC5B,OAAO;CAET,KAAK,MAAM,CAAC,MAAM,gBAAgB,OAAO,QAAQ,QAAQ,GACvD,IACG,SAAS,UAAU,SAAS,WAC5B,gBAAgB,KAAA,KACf,OAAO,gBAAgB,YACvB,CAAC,MAAM,QAAQ,WAAW,KAC1B,CAACA,cAAAA,iBAAiB,WAAW,GAE/B,OAAO;CAGX,OAAO;AACT;AAEA,SAAgB,0BACd,WACA,UACmC;CACnC,IAAI,CAACA,cAAAA,iBAAiB,SAAS,GAC7B,MAAM,IAAIC,cAAAA,cAAc,eAAe,oCAAoC,EACzE,SACF,CAAC;CAEH,MAAM,WAAW,OAAO,QAAQ,SAAS;CACzC,IAAI,SAAS,WAAW,GAC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AAc,UAAU;CAAO;AACzD"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
const require_traceMarker = require("./traceMarker.cjs");
|
|
2
|
+
const require_types = require("./types.cjs");
|
|
3
|
+
const require_questions = require("./questions.cjs");
|
|
4
|
+
const require_deadline = require("./deadline.cjs");
|
|
5
|
+
const require_transport = require("./transport.cjs");
|
|
6
|
+
let _langchain_core_messages = require("@langchain/core/messages");
|
|
7
|
+
//#region src/decisions/structuredChat.ts
|
|
8
|
+
const MAX_QUESTIONS = 32;
|
|
9
|
+
const MAX_CHOICE_OPTIONS = 128;
|
|
10
|
+
const DEFAULT_TIMEOUT_MS = 2e4;
|
|
11
|
+
const PROVIDER_ID = "structured-chat";
|
|
12
|
+
function readChatUsage(raw) {
|
|
13
|
+
if (!require_types.isDecisionObject(raw)) return null;
|
|
14
|
+
const usage = require_types.readDecisionUsage(raw.usage_metadata);
|
|
15
|
+
const response = require_types.isDecisionObject(raw.response_metadata) ? raw.response_metadata : null;
|
|
16
|
+
const nested = require_types.isDecisionObject(response?.metadata) ? response.metadata : null;
|
|
17
|
+
const bedrock = require_types.isDecisionObject(nested?.usage) ? nested.usage : response?.usage;
|
|
18
|
+
if (usage?.inputTokens === void 0 || !require_types.isDecisionObject(bedrock) || usage.inputTokens !== bedrock.inputTokens) return usage;
|
|
19
|
+
const read = bedrock.cacheReadInputTokens;
|
|
20
|
+
const write = bedrock.cacheWriteInputTokens;
|
|
21
|
+
if (read != null && (typeof read !== "number" || !Number.isSafeInteger(read) || read < 0) || write != null && (typeof write !== "number" || !Number.isSafeInteger(write) || write < 0)) return usage;
|
|
22
|
+
const inputTokens = usage.inputTokens + (typeof read === "number" ? read : 0) + (typeof write === "number" ? write : 0);
|
|
23
|
+
return Number.isSafeInteger(inputTokens) ? {
|
|
24
|
+
...usage,
|
|
25
|
+
inputTokens
|
|
26
|
+
} : usage;
|
|
27
|
+
}
|
|
28
|
+
function providerFailure(error, provider) {
|
|
29
|
+
const details = require_types.isDecisionObject(error) ? error : null;
|
|
30
|
+
const metadata = require_types.isDecisionObject(details?.$metadata) ? details.$metadata : null;
|
|
31
|
+
const rawStatus = details?.status ?? details?.statusCode ?? metadata?.httpStatusCode;
|
|
32
|
+
const status = typeof rawStatus === "number" && Number.isInteger(rawStatus) && rawStatus >= 100 && rawStatus <= 599 ? rawStatus : void 0;
|
|
33
|
+
const failure = new require_types.DecisionError(status == null ? "network" : require_transport.failureForStatus(status), "structured decision model request failed", {
|
|
34
|
+
provider,
|
|
35
|
+
status
|
|
36
|
+
});
|
|
37
|
+
const headers = details?.headers;
|
|
38
|
+
if (headers instanceof Headers) failure.retryAfterMs = require_transport.retryAfterMs(headers.get("retry-after"));
|
|
39
|
+
return failure;
|
|
40
|
+
}
|
|
41
|
+
function decisionSchema(entries) {
|
|
42
|
+
const properties = Object.create(null);
|
|
43
|
+
for (const [id, question] of entries) {
|
|
44
|
+
if (question.type === "boolean") {
|
|
45
|
+
properties[id] = {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: { decision: { type: "boolean" } },
|
|
48
|
+
required: ["decision"],
|
|
49
|
+
additionalProperties: false
|
|
50
|
+
};
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
properties[id] = {
|
|
54
|
+
type: "object",
|
|
55
|
+
properties: { choice: {
|
|
56
|
+
type: "string",
|
|
57
|
+
enum: Object.keys(question.criteria)
|
|
58
|
+
} },
|
|
59
|
+
required: ["choice"],
|
|
60
|
+
additionalProperties: false
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
type: "object",
|
|
65
|
+
properties: { answers: {
|
|
66
|
+
type: "object",
|
|
67
|
+
properties,
|
|
68
|
+
required: entries.map(([id]) => id),
|
|
69
|
+
additionalProperties: false
|
|
70
|
+
} },
|
|
71
|
+
required: ["answers"],
|
|
72
|
+
additionalProperties: false
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function readDecisions(parsed, entries, provider) {
|
|
76
|
+
const invalid = () => new require_types.DecisionError("malformed_response", "invalid structured decision model answer", { provider });
|
|
77
|
+
if (!require_types.isDecisionObject(parsed) || Object.keys(parsed).length !== 1 || !require_types.isDecisionObject(parsed.answers) || Object.keys(parsed.answers).length !== entries.length) throw invalid();
|
|
78
|
+
const answers = Object.create(null);
|
|
79
|
+
for (const [id, question] of entries) {
|
|
80
|
+
if (!Object.hasOwn(parsed.answers, id)) throw invalid();
|
|
81
|
+
const raw = parsed.answers[id];
|
|
82
|
+
if (!require_types.isDecisionObject(raw) || Object.keys(raw).length !== 1) throw invalid();
|
|
83
|
+
if (question.type === "boolean") {
|
|
84
|
+
if (typeof raw.decision !== "boolean") throw invalid();
|
|
85
|
+
answers[id] = {
|
|
86
|
+
type: "boolean",
|
|
87
|
+
decision: raw.decision,
|
|
88
|
+
probability: null
|
|
89
|
+
};
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (question.type !== "choice" || typeof raw.choice !== "string" || !Object.hasOwn(question.criteria, raw.choice)) throw invalid();
|
|
93
|
+
answers[id] = {
|
|
94
|
+
type: "choice",
|
|
95
|
+
choice: raw.choice,
|
|
96
|
+
confidence: null,
|
|
97
|
+
probabilities: null
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return answers;
|
|
101
|
+
}
|
|
102
|
+
function questionsForChat(questions, provider, maxQuestions) {
|
|
103
|
+
const entries = require_questions.validateDecisionQuestions(questions, provider);
|
|
104
|
+
let choices = 0;
|
|
105
|
+
for (const [, question] of entries) {
|
|
106
|
+
if (question.type === "score") throw new require_types.DecisionError("unsupported_question", "chat decision cannot score expected values", { provider });
|
|
107
|
+
if (question.type === "choice") choices += Object.keys(question.criteria).length;
|
|
108
|
+
}
|
|
109
|
+
if (entries.length > maxQuestions || choices > MAX_CHOICE_OPTIONS) throw new require_types.DecisionError("unsupported_question", "decision model question batch too large", { provider });
|
|
110
|
+
return entries;
|
|
111
|
+
}
|
|
112
|
+
function createStructuredChatDecisionModel(options) {
|
|
113
|
+
const provider = options.providerId ?? PROVIDER_ID;
|
|
114
|
+
if (!["jsonSchema", "functionCalling"].includes(options.method)) throw new require_types.DecisionError("unsupported_mode", "unsupported structured decision model mode", { provider });
|
|
115
|
+
if (!options.modelId.trim()) throw new require_types.DecisionError("bad_request", "decision model requires a model id", { provider });
|
|
116
|
+
const maxQuestions = options.maxQuestions ?? MAX_QUESTIONS;
|
|
117
|
+
if (!Number.isSafeInteger(maxQuestions) || maxQuestions < 1 || maxQuestions > MAX_QUESTIONS) throw new require_types.DecisionError("bad_request", "invalid decision model question limit", { provider });
|
|
118
|
+
const { model, method } = options;
|
|
119
|
+
const modelId = options.modelId.trim();
|
|
120
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
121
|
+
const onAnswered = options.onAnswered;
|
|
122
|
+
return {
|
|
123
|
+
id: provider,
|
|
124
|
+
model: modelId,
|
|
125
|
+
async decide(request) {
|
|
126
|
+
const started = performance.now();
|
|
127
|
+
return require_deadline.withDecisionDeadline(provider, request.timeoutMs ?? timeoutMs, request.signal, async (signal, waitFor) => {
|
|
128
|
+
let entries;
|
|
129
|
+
let input;
|
|
130
|
+
try {
|
|
131
|
+
entries = questionsForChat(request.questions, provider, maxQuestions);
|
|
132
|
+
input = require_traceMarker.DECISION_PROMPT_PREFIX + JSON.stringify({
|
|
133
|
+
state: request.state,
|
|
134
|
+
questions: Object.fromEntries(entries)
|
|
135
|
+
});
|
|
136
|
+
} catch (error) {
|
|
137
|
+
if (error instanceof require_types.DecisionError) throw error;
|
|
138
|
+
throw new require_types.DecisionError("bad_request", "invalid decision model request", { provider });
|
|
139
|
+
}
|
|
140
|
+
let structured;
|
|
141
|
+
try {
|
|
142
|
+
const adapter = model._llmType();
|
|
143
|
+
if (adapter !== "openai" && (adapter !== "anthropic" || method !== "functionCalling")) throw new Error("unverified strict decision model adapter");
|
|
144
|
+
structured = model.withStructuredOutput(decisionSchema(entries), {
|
|
145
|
+
name: "DecideQuestions",
|
|
146
|
+
method,
|
|
147
|
+
strict: true,
|
|
148
|
+
includeRaw: true
|
|
149
|
+
});
|
|
150
|
+
} catch {
|
|
151
|
+
throw new require_types.DecisionError("unsupported_mode", "model cannot enforce the requested strict mode", { provider });
|
|
152
|
+
}
|
|
153
|
+
await waitFor(Promise.resolve());
|
|
154
|
+
let output;
|
|
155
|
+
try {
|
|
156
|
+
output = await waitFor(structured.invoke([new _langchain_core_messages.SystemMessage("Classify the state using the questions. Return only the required decisions. Do not estimate probabilities, confidence, or token usage."), new _langchain_core_messages.HumanMessage(input)], { signal }));
|
|
157
|
+
} catch (error) {
|
|
158
|
+
if (error instanceof require_types.DecisionError) throw error;
|
|
159
|
+
throw providerFailure(error, provider);
|
|
160
|
+
}
|
|
161
|
+
const result = {
|
|
162
|
+
model: modelId,
|
|
163
|
+
answers: readDecisions(output.parsed, entries, provider),
|
|
164
|
+
usage: readChatUsage(output.raw)
|
|
165
|
+
};
|
|
166
|
+
await waitFor(Promise.resolve());
|
|
167
|
+
try {
|
|
168
|
+
onAnswered?.(request.label ?? "decide", performance.now() - started);
|
|
169
|
+
} catch {}
|
|
170
|
+
return result;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
exports.createStructuredChatDecisionModel = createStructuredChatDecisionModel;
|
|
177
|
+
|
|
178
|
+
//# sourceMappingURL=structuredChat.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structuredChat.cjs","names":["isDecisionObject","readDecisionUsage","DecisionError","failureForStatus","retryAfterMs","validateDecisionQuestions","withDecisionDeadline","DECISION_PROMPT_PREFIX","SystemMessage","HumanMessage"],"sources":["../../../src/decisions/structuredChat.ts"],"mappings":";;;;;;;AAcA,MAAM,gBAAgB;AACtB,MAAM,qBAAqB;AAC3B,MAAM,qBAAqB;AAC3B,MAAM,cAAc;AAEpB,SAAgB,cAAc,KAAuC;CACnE,IAAI,CA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AQ,SAAS,QAG9C;KACN,OAAO,cAAc,OAAO,GAAG;IACjC;IACA,MAAM,QAAQ,QAAQ,QAAQ,CAAC;IAC/B,IAAI;KACF,aACE,QAAQ,SAAS,UACjB,YAAY,IAAI,IAAI,OACtB;IACF,QAAQ,CAER;IACA,OAAO;GACT,CACF;EACF;CACF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceMarker.cjs","names":[],"sources":["../../../src/decisions/traceMarker.ts"],"mappings":";AACA,MAAa,yBAAyB"}
|