@spendgraph/workflows 0.2.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 +149 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/noesis/attribution.d.ts +24 -0
- package/dist/noesis/attribution.js +43 -0
- package/dist/noesis/context.d.ts +18 -0
- package/dist/noesis/context.js +16 -0
- package/dist/noesis/draft/draft.d.ts +18 -0
- package/dist/noesis/draft/draft.js +50 -0
- package/dist/noesis/draft/index.d.ts +2 -0
- package/dist/noesis/draft/index.js +1 -0
- package/dist/noesis/draft/types.d.ts +27 -0
- package/dist/noesis/draft/types.js +1 -0
- package/dist/noesis/events.d.ts +158 -0
- package/dist/noesis/events.js +24 -0
- package/dist/noesis/execute/execute.d.ts +22 -0
- package/dist/noesis/execute/execute.js +85 -0
- package/dist/noesis/execute/index.d.ts +3 -0
- package/dist/noesis/execute/index.js +2 -0
- package/dist/noesis/execute/order.d.ts +11 -0
- package/dist/noesis/execute/order.js +28 -0
- package/dist/noesis/execute/types.d.ts +37 -0
- package/dist/noesis/execute/types.js +1 -0
- package/dist/noesis/gates/closure-checklist/index.d.ts +3 -0
- package/dist/noesis/gates/closure-checklist/index.js +2 -0
- package/dist/noesis/gates/closure-checklist/invoke.d.ts +5 -0
- package/dist/noesis/gates/closure-checklist/invoke.js +6 -0
- package/dist/noesis/gates/closure-checklist/prompt.d.ts +5 -0
- package/dist/noesis/gates/closure-checklist/prompt.js +32 -0
- package/dist/noesis/gates/closure-checklist/types.d.ts +20 -0
- package/dist/noesis/gates/closure-checklist/types.js +1 -0
- package/dist/noesis/gates/cqot-gate/index.d.ts +3 -0
- package/dist/noesis/gates/cqot-gate/index.js +2 -0
- package/dist/noesis/gates/cqot-gate/invoke.d.ts +5 -0
- package/dist/noesis/gates/cqot-gate/invoke.js +6 -0
- package/dist/noesis/gates/cqot-gate/prompt.d.ts +5 -0
- package/dist/noesis/gates/cqot-gate/prompt.js +27 -0
- package/dist/noesis/gates/cqot-gate/types.d.ts +23 -0
- package/dist/noesis/gates/cqot-gate/types.js +1 -0
- package/dist/noesis/gates/premortem/index.d.ts +3 -0
- package/dist/noesis/gates/premortem/index.js +2 -0
- package/dist/noesis/gates/premortem/invoke.d.ts +5 -0
- package/dist/noesis/gates/premortem/invoke.js +6 -0
- package/dist/noesis/gates/premortem/prompt.d.ts +5 -0
- package/dist/noesis/gates/premortem/prompt.js +37 -0
- package/dist/noesis/gates/premortem/types.d.ts +28 -0
- package/dist/noesis/gates/premortem/types.js +1 -0
- package/dist/noesis/gates/red-team/index.d.ts +3 -0
- package/dist/noesis/gates/red-team/index.js +2 -0
- package/dist/noesis/gates/red-team/invoke.d.ts +5 -0
- package/dist/noesis/gates/red-team/invoke.js +6 -0
- package/dist/noesis/gates/red-team/prompt.d.ts +5 -0
- package/dist/noesis/gates/red-team/prompt.js +25 -0
- package/dist/noesis/gates/red-team/types.d.ts +21 -0
- package/dist/noesis/gates/red-team/types.js +1 -0
- package/dist/noesis/gates/standards-review/index.d.ts +3 -0
- package/dist/noesis/gates/standards-review/index.js +2 -0
- package/dist/noesis/gates/standards-review/invoke.d.ts +5 -0
- package/dist/noesis/gates/standards-review/invoke.js +6 -0
- package/dist/noesis/gates/standards-review/prompt.d.ts +5 -0
- package/dist/noesis/gates/standards-review/prompt.js +26 -0
- package/dist/noesis/gates/standards-review/types.d.ts +20 -0
- package/dist/noesis/gates/standards-review/types.js +1 -0
- package/dist/noesis/gates/think-checkpoint/index.d.ts +3 -0
- package/dist/noesis/gates/think-checkpoint/index.js +2 -0
- package/dist/noesis/gates/think-checkpoint/invoke.d.ts +5 -0
- package/dist/noesis/gates/think-checkpoint/invoke.js +6 -0
- package/dist/noesis/gates/think-checkpoint/prompt.d.ts +5 -0
- package/dist/noesis/gates/think-checkpoint/prompt.js +28 -0
- package/dist/noesis/gates/think-checkpoint/types.d.ts +21 -0
- package/dist/noesis/gates/think-checkpoint/types.js +1 -0
- package/dist/noesis/index.d.ts +51 -0
- package/dist/noesis/index.js +27 -0
- package/dist/noesis/producers/cove-answers/index.d.ts +3 -0
- package/dist/noesis/producers/cove-answers/index.js +2 -0
- package/dist/noesis/producers/cove-answers/invoke.d.ts +5 -0
- package/dist/noesis/producers/cove-answers/invoke.js +6 -0
- package/dist/noesis/producers/cove-answers/prompt.d.ts +5 -0
- package/dist/noesis/producers/cove-answers/prompt.js +27 -0
- package/dist/noesis/producers/cove-answers/types.d.ts +32 -0
- package/dist/noesis/producers/cove-answers/types.js +1 -0
- package/dist/noesis/producers/cove-questions/index.d.ts +3 -0
- package/dist/noesis/producers/cove-questions/index.js +2 -0
- package/dist/noesis/producers/cove-questions/invoke.d.ts +5 -0
- package/dist/noesis/producers/cove-questions/invoke.js +6 -0
- package/dist/noesis/producers/cove-questions/prompt.d.ts +5 -0
- package/dist/noesis/producers/cove-questions/prompt.js +26 -0
- package/dist/noesis/producers/cove-questions/types.d.ts +17 -0
- package/dist/noesis/producers/cove-questions/types.js +1 -0
- package/dist/noesis/producers/decompose/index.d.ts +3 -0
- package/dist/noesis/producers/decompose/index.js +2 -0
- package/dist/noesis/producers/decompose/invoke.d.ts +5 -0
- package/dist/noesis/producers/decompose/invoke.js +6 -0
- package/dist/noesis/producers/decompose/prompt.d.ts +22 -0
- package/dist/noesis/producers/decompose/prompt.js +68 -0
- package/dist/noesis/producers/decompose/types.d.ts +41 -0
- package/dist/noesis/producers/decompose/types.js +1 -0
- package/dist/noesis/producers/discriminating-test/index.d.ts +3 -0
- package/dist/noesis/producers/discriminating-test/index.js +2 -0
- package/dist/noesis/producers/discriminating-test/invoke.d.ts +5 -0
- package/dist/noesis/producers/discriminating-test/invoke.js +6 -0
- package/dist/noesis/producers/discriminating-test/prompt.d.ts +5 -0
- package/dist/noesis/producers/discriminating-test/prompt.js +67 -0
- package/dist/noesis/producers/discriminating-test/types.d.ts +32 -0
- package/dist/noesis/producers/discriminating-test/types.js +1 -0
- package/dist/noesis/producers/plan-candidates/index.d.ts +3 -0
- package/dist/noesis/producers/plan-candidates/index.js +2 -0
- package/dist/noesis/producers/plan-candidates/invoke.d.ts +5 -0
- package/dist/noesis/producers/plan-candidates/invoke.js +6 -0
- package/dist/noesis/producers/plan-candidates/prompt.d.ts +5 -0
- package/dist/noesis/producers/plan-candidates/prompt.js +46 -0
- package/dist/noesis/producers/plan-candidates/types.d.ts +32 -0
- package/dist/noesis/producers/plan-candidates/types.js +1 -0
- package/dist/noesis/producers/qn-brief/index.d.ts +3 -0
- package/dist/noesis/producers/qn-brief/index.js +2 -0
- package/dist/noesis/producers/qn-brief/invoke.d.ts +5 -0
- package/dist/noesis/producers/qn-brief/invoke.js +6 -0
- package/dist/noesis/producers/qn-brief/prompt.d.ts +12 -0
- package/dist/noesis/producers/qn-brief/prompt.js +65 -0
- package/dist/noesis/producers/qn-brief/types.d.ts +42 -0
- package/dist/noesis/producers/qn-brief/types.js +1 -0
- package/dist/noesis/producers/toulmin/answer.d.ts +18 -0
- package/dist/noesis/producers/toulmin/answer.js +87 -0
- package/dist/noesis/producers/toulmin/index.d.ts +5 -0
- package/dist/noesis/producers/toulmin/index.js +4 -0
- package/dist/noesis/producers/toulmin/invoke.d.ts +18 -0
- package/dist/noesis/producers/toulmin/invoke.js +53 -0
- package/dist/noesis/producers/toulmin/prompt.d.ts +12 -0
- package/dist/noesis/producers/toulmin/prompt.js +60 -0
- package/dist/noesis/producers/toulmin/render.d.ts +14 -0
- package/dist/noesis/producers/toulmin/render.js +82 -0
- package/dist/noesis/producers/toulmin/types.d.ts +126 -0
- package/dist/noesis/producers/toulmin/types.js +1 -0
- package/dist/noesis/question.d.ts +24 -0
- package/dist/noesis/question.js +37 -0
- package/dist/noesis/repair/reflection/index.d.ts +3 -0
- package/dist/noesis/repair/reflection/index.js +2 -0
- package/dist/noesis/repair/reflection/invoke.d.ts +5 -0
- package/dist/noesis/repair/reflection/invoke.js +6 -0
- package/dist/noesis/repair/reflection/prompt.d.ts +5 -0
- package/dist/noesis/repair/reflection/prompt.js +26 -0
- package/dist/noesis/repair/reflection/types.d.ts +17 -0
- package/dist/noesis/repair/reflection/types.js +1 -0
- package/dist/noesis/retry.d.ts +25 -0
- package/dist/noesis/retry.js +60 -0
- package/dist/noesis/route.d.ts +29 -0
- package/dist/noesis/route.js +69 -0
- package/dist/noesis/router/triage/index.d.ts +3 -0
- package/dist/noesis/router/triage/index.js +2 -0
- package/dist/noesis/router/triage/invoke.d.ts +31 -0
- package/dist/noesis/router/triage/invoke.js +76 -0
- package/dist/noesis/router/triage/prompt.d.ts +11 -0
- package/dist/noesis/router/triage/prompt.js +34 -0
- package/dist/noesis/router/triage/types.d.ts +70 -0
- package/dist/noesis/router/triage/types.js +1 -0
- package/dist/noesis/run/artifacts.d.ts +12 -0
- package/dist/noesis/run/artifacts.js +31 -0
- package/dist/noesis/run/errors.d.ts +38 -0
- package/dist/noesis/run/errors.js +55 -0
- package/dist/noesis/run/index.d.ts +6 -0
- package/dist/noesis/run/index.js +4 -0
- package/dist/noesis/run/ledger.d.ts +110 -0
- package/dist/noesis/run/ledger.js +184 -0
- package/dist/noesis/run/loop.d.ts +15 -0
- package/dist/noesis/run/loop.js +91 -0
- package/dist/noesis/run/plan.d.ts +18 -0
- package/dist/noesis/run/plan.js +39 -0
- package/dist/noesis/run/produce.d.ts +50 -0
- package/dist/noesis/run/produce.js +114 -0
- package/dist/noesis/run/redo.d.ts +24 -0
- package/dist/noesis/run/redo.js +41 -0
- package/dist/noesis/run/result.d.ts +5 -0
- package/dist/noesis/run/result.js +51 -0
- package/dist/noesis/run/run.d.ts +4 -0
- package/dist/noesis/run/run.js +73 -0
- package/dist/noesis/run/stages/classify.d.ts +7 -0
- package/dist/noesis/run/stages/classify.js +23 -0
- package/dist/noesis/run/stages/direct.d.ts +6 -0
- package/dist/noesis/run/stages/direct.js +8 -0
- package/dist/noesis/run/stages/full.d.ts +14 -0
- package/dist/noesis/run/stages/full.js +21 -0
- package/dist/noesis/run/stages/index.d.ts +5 -0
- package/dist/noesis/run/stages/index.js +5 -0
- package/dist/noesis/run/stages/retrieve.d.ts +13 -0
- package/dist/noesis/run/stages/retrieve.js +38 -0
- package/dist/noesis/run/stages/standard.d.ts +12 -0
- package/dist/noesis/run/stages/standard.js +19 -0
- package/dist/noesis/run/state.d.ts +26 -0
- package/dist/noesis/run/state.js +13 -0
- package/dist/noesis/run/stream.d.ts +28 -0
- package/dist/noesis/run/stream.js +33 -0
- package/dist/noesis/run/verify.d.ts +27 -0
- package/dist/noesis/run/verify.js +78 -0
- package/dist/noesis/slugs.d.ts +16 -0
- package/dist/noesis/slugs.js +46 -0
- package/dist/noesis/stage.d.ts +56 -0
- package/dist/noesis/stage.js +52 -0
- package/dist/noesis/started.d.ts +18 -0
- package/dist/noesis/started.js +39 -0
- package/dist/noesis/types.d.ts +167 -0
- package/dist/noesis/types.js +1 -0
- package/dist/noesis/usage.d.ts +49 -0
- package/dist/noesis/usage.js +56 -0
- package/dist/noesis/verify/index.d.ts +2 -0
- package/dist/noesis/verify/index.js +1 -0
- package/dist/noesis/verify/types.d.ts +54 -0
- package/dist/noesis/verify/types.js +1 -0
- package/dist/noesis/verify/verify.d.ts +36 -0
- package/dist/noesis/verify/verify.js +94 -0
- package/package.json +59 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export { stageCited, unattributed } from "./attribution.js";
|
|
2
|
+
export type { Asked } from "./context.js";
|
|
3
|
+
export { asked } from "./context.js";
|
|
4
|
+
export type { Draft, Finding, Missing } from "./draft/index.js";
|
|
5
|
+
export { assemble, render as renderDraft } from "./draft/index.js";
|
|
6
|
+
export type { Emit, EventBase, NoesisEvent, NoesisEventInput } from "./events.js";
|
|
7
|
+
export { emitter } from "./events.js";
|
|
8
|
+
export type { ExecuteOptions, Execution, SubAnswer, Waves, Wiring, } from "./execute/index.js";
|
|
9
|
+
export { DEFAULT_TOOLS, execute, order } from "./execute/index.js";
|
|
10
|
+
export type { ClosureChecklist, ClosureChecklistInput, ClosureChecklistOptions, ClosureChecklistResult, ClosureGate, } from "./gates/closure-checklist/index.js";
|
|
11
|
+
export { invoke as closureChecklist } from "./gates/closure-checklist/index.js";
|
|
12
|
+
export type { CqotGate, CqotGateInput, CqotGateOptions, CqotGateResult, Gate, GateQuestion, GateVerdict, } from "./gates/cqot-gate/index.js";
|
|
13
|
+
export { invoke as cqotGate } from "./gates/cqot-gate/index.js";
|
|
14
|
+
export type { Damage, FailureCause, Inversion, Likelihood, Premortem, PremortemInput, PremortemOptions, PremortemResult, PremortemVerdict, } from "./gates/premortem/index.js";
|
|
15
|
+
export { invoke as premortem } from "./gates/premortem/index.js";
|
|
16
|
+
export type { Objection, RedTeam, RedTeamInput, RedTeamOptions, RedTeamResult, RedTeamVerdict, Severity, } from "./gates/red-team/index.js";
|
|
17
|
+
export { invoke as redTeam } from "./gates/red-team/index.js";
|
|
18
|
+
export type { Criterion, CriterionVerdict, ReviewOutcome, StandardsReview, StandardsReviewInput, StandardsReviewOptions, StandardsReviewResult, } from "./gates/standards-review/index.js";
|
|
19
|
+
export { invoke as standardsReview } from "./gates/standards-review/index.js";
|
|
20
|
+
export type { Divergence, NextAction, ThinkCheckpoint, ThinkCheckpointInput, ThinkCheckpointOptions, ThinkCheckpointResult, } from "./gates/think-checkpoint/index.js";
|
|
21
|
+
export { invoke as thinkCheckpoint } from "./gates/think-checkpoint/index.js";
|
|
22
|
+
export type { CheckedBy, CoveAnswers, CoveAnswersInput, CoveAnswersOptions, CoveAnswersResult, VerificationAnswer, } from "./producers/cove-answers/index.js";
|
|
23
|
+
export { invoke as coveAnswers } from "./producers/cove-answers/index.js";
|
|
24
|
+
export type { ClaimType, CoveQuestions, CoveQuestionsInput, CoveQuestionsOptions, CoveQuestionsResult, VerificationQuestion, } from "./producers/cove-questions/index.js";
|
|
25
|
+
export { invoke as coveQuestions } from "./producers/cove-questions/index.js";
|
|
26
|
+
export type { DecomposeInput, DecomposeOptions, DecomposeResult, Decomposition, SubQuestion, SubQuestionKind, SubQuestionTool, } from "./producers/decompose/index.js";
|
|
27
|
+
export { invoke as decompose } from "./producers/decompose/index.js";
|
|
28
|
+
export type { DiscriminatingTest, DiscriminatingTestInput, DiscriminatingTestOptions, DiscriminatingTestResult, ExpectedResult, Hypothesis, RejectedTest, } from "./producers/discriminating-test/index.js";
|
|
29
|
+
export { invoke as discriminatingTest } from "./producers/discriminating-test/index.js";
|
|
30
|
+
export type { PlanCandidate, PlanCandidates, PlanCandidatesInput, PlanCandidatesOptions, PlanCandidatesResult, PlanStep, SwitchTrigger, } from "./producers/plan-candidates/index.js";
|
|
31
|
+
export { invoke as planCandidates } from "./producers/plan-candidates/index.js";
|
|
32
|
+
export type { BriefInput, BriefOptions, BriefResult, KeyConcept, QuestionBrief, Viewpoint, } from "./producers/qn-brief/index.js";
|
|
33
|
+
export { invoke as brief } from "./producers/qn-brief/index.js";
|
|
34
|
+
export type { AnswerOptions, AnswerResult, AnswerTier, Artifacts, Ground, Qualifier, Rebuttal, ToulminAnswer, ToulminOptions, ToulminResult, } from "./producers/toulmin/index.js";
|
|
35
|
+
export { answer, invoke as toulmin, NoAnswerError, render, ToulminReplyError, } from "./producers/toulmin/index.js";
|
|
36
|
+
export type { Reflection, ReflectionInput, ReflectionOptions, ReflectionResult, } from "./repair/reflection/index.js";
|
|
37
|
+
export { invoke as reflection } from "./repair/reflection/index.js";
|
|
38
|
+
export { routeFor } from "./route.js";
|
|
39
|
+
export type { Difficulty, Stakes, TriageEstimates, TriageInput, TriageOptions, TriageResult, } from "./router/triage/index.js";
|
|
40
|
+
export { invoke as triage, TriageReplyError } from "./router/triage/index.js";
|
|
41
|
+
export type { Entry, Escalation, Ledger, NoesisStream, Recorded, StageId, StageUsage, } from "./run/index.js";
|
|
42
|
+
export { NoToolsError, newLedger, RouteFailedError, RouteNotBuiltError, run, runStream, STAGE_NAMES, STAGES, } from "./run/index.js";
|
|
43
|
+
export { dropPoint, parseStage, resumeAt } from "./run/redo.js";
|
|
44
|
+
export { STAGE_OF_SLUG } from "./slugs.js";
|
|
45
|
+
export type { StageOptions, StageOutcome } from "./stage.js";
|
|
46
|
+
export { runStage, StageReplyError } from "./stage.js";
|
|
47
|
+
export type { Ask, AskedOfYou, NoesisOptions, NoesisResult, RetrieveOptions, Route, Routing, RunUsage, Status, VerifyOptions, } from "./types.js";
|
|
48
|
+
export type { PartialUsage, Usage } from "./usage.js";
|
|
49
|
+
export { addUsage, billableTokens, NO_USAGE, spend, usageOf } from "./usage.js";
|
|
50
|
+
export type { Checked, Verification } from "./verify/index.js";
|
|
51
|
+
export { blind, compare, render as renderChecks, SETTLED_WITHOUT_TOOLS, } from "./verify/index.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { stageCited, unattributed } from "./attribution.js";
|
|
2
|
+
export { asked } from "./context.js";
|
|
3
|
+
export { assemble, render as renderDraft } from "./draft/index.js";
|
|
4
|
+
export { emitter } from "./events.js";
|
|
5
|
+
export { DEFAULT_TOOLS, execute, order } from "./execute/index.js";
|
|
6
|
+
export { invoke as closureChecklist } from "./gates/closure-checklist/index.js";
|
|
7
|
+
export { invoke as cqotGate } from "./gates/cqot-gate/index.js";
|
|
8
|
+
export { invoke as premortem } from "./gates/premortem/index.js";
|
|
9
|
+
export { invoke as redTeam } from "./gates/red-team/index.js";
|
|
10
|
+
export { invoke as standardsReview } from "./gates/standards-review/index.js";
|
|
11
|
+
export { invoke as thinkCheckpoint } from "./gates/think-checkpoint/index.js";
|
|
12
|
+
export { invoke as coveAnswers } from "./producers/cove-answers/index.js";
|
|
13
|
+
export { invoke as coveQuestions } from "./producers/cove-questions/index.js";
|
|
14
|
+
export { invoke as decompose } from "./producers/decompose/index.js";
|
|
15
|
+
export { invoke as discriminatingTest } from "./producers/discriminating-test/index.js";
|
|
16
|
+
export { invoke as planCandidates } from "./producers/plan-candidates/index.js";
|
|
17
|
+
export { invoke as brief } from "./producers/qn-brief/index.js";
|
|
18
|
+
export { answer, invoke as toulmin, NoAnswerError, render, ToulminReplyError, } from "./producers/toulmin/index.js";
|
|
19
|
+
export { invoke as reflection } from "./repair/reflection/index.js";
|
|
20
|
+
export { routeFor } from "./route.js";
|
|
21
|
+
export { invoke as triage, TriageReplyError } from "./router/triage/index.js";
|
|
22
|
+
export { NoToolsError, newLedger, RouteFailedError, RouteNotBuiltError, run, runStream, STAGE_NAMES, STAGES, } from "./run/index.js";
|
|
23
|
+
export { dropPoint, parseStage, resumeAt } from "./run/redo.js";
|
|
24
|
+
export { STAGE_OF_SLUG } from "./slugs.js";
|
|
25
|
+
export { runStage, StageReplyError } from "./stage.js";
|
|
26
|
+
export { addUsage, billableTokens, NO_USAGE, spend, usageOf } from "./usage.js";
|
|
27
|
+
export { blind, compare, render as renderChecks, SETTLED_WITHOUT_TOOLS, } from "./verify/index.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Llm } from "@spendgraph/llms";
|
|
2
|
+
import type { PromptClient } from "@spendgraph/prompt";
|
|
3
|
+
import type { CoveAnswersInput, CoveAnswersOptions, CoveAnswersResult } from "./types.js";
|
|
4
|
+
/** Stage 5B. Each verification question answered blind, without sight of the answer under test. */
|
|
5
|
+
export declare function invoke(client: PromptClient, llm: Llm, input: CoveAnswersInput, opts?: CoveAnswersOptions): Promise<CoveAnswersResult>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { runStage } from "../../stage.js";
|
|
2
|
+
import { COVE_ANSWERS_SCHEMA, COVE_ANSWERS_SLUG } from "./prompt.js";
|
|
3
|
+
/** Stage 5B. Each verification question answered blind, without sight of the answer under test. */
|
|
4
|
+
export function invoke(client, llm, input, opts = {}) {
|
|
5
|
+
return runStage(client, llm, COVE_ANSWERS_SLUG, COVE_ANSWERS_SCHEMA, input, opts);
|
|
6
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsonSchema } from "@spendgraph/llms";
|
|
2
|
+
/** Stage 5B. Pulled by slug, so an edit needs no release here. */
|
|
3
|
+
export declare const COVE_ANSWERS_SLUG = "ctr-5b-cove-blind-answer-1w1479";
|
|
4
|
+
/** What the reply must be, as the prompt itself specifies it. */
|
|
5
|
+
export declare const COVE_ANSWERS_SCHEMA: JsonSchema;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Stage 5B. Pulled by slug, so an edit needs no release here. */
|
|
2
|
+
export const COVE_ANSWERS_SLUG = "ctr-5b-cove-blind-answer-1w1479";
|
|
3
|
+
/** What the reply must be, as the prompt itself specifies it. */
|
|
4
|
+
export const COVE_ANSWERS_SCHEMA = {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
answers: {
|
|
8
|
+
type: "array",
|
|
9
|
+
items: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
id: { type: "string" },
|
|
13
|
+
answer: { type: "string" },
|
|
14
|
+
confidence: { type: "number", minimum: 0, maximum: 1 },
|
|
15
|
+
unknown: { type: "boolean" },
|
|
16
|
+
as_of: { type: ["string", "null"] },
|
|
17
|
+
checked_by: {
|
|
18
|
+
type: "string",
|
|
19
|
+
enum: ["knowledge", "deeprecall", "web_search"],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
required: ["id", "answer", "confidence", "unknown", "as_of", "checked_by"],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ["answers"],
|
|
27
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Asked } from "../../context.js";
|
|
2
|
+
import type { StageOptions, StageOutcome } from "../../stage.js";
|
|
3
|
+
/**
|
|
4
|
+
* How a blind check was settled.
|
|
5
|
+
*
|
|
6
|
+
* Spelled `deeprecall` rather than `deep_recall` so it is identical to the
|
|
7
|
+
* `SubQuestionTool` of the same name: the two enums describe the same thing
|
|
8
|
+
* from either end of a lookup, and a translation table between them is one more
|
|
9
|
+
* thing that can drift.
|
|
10
|
+
*
|
|
11
|
+
* `knowledge` means the model's own parametric memory and nothing else. A value
|
|
12
|
+
* here is a claim about provenance, and `compare()` will not take the stage's
|
|
13
|
+
* word for it — see `SETTLED_WITHOUT_TOOLS`.
|
|
14
|
+
*/
|
|
15
|
+
export type CheckedBy = "knowledge" | "deeprecall" | "web_search";
|
|
16
|
+
export interface VerificationAnswer {
|
|
17
|
+
/** Matches the question id it answers. */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Empty when `unknown` is true. */
|
|
20
|
+
answer: string;
|
|
21
|
+
confidence: number;
|
|
22
|
+
unknown: boolean;
|
|
23
|
+
/** Null when the fact is time-invariant. */
|
|
24
|
+
as_of: string | null;
|
|
25
|
+
checked_by: CheckedBy;
|
|
26
|
+
}
|
|
27
|
+
export interface CoveAnswers {
|
|
28
|
+
answers: VerificationAnswer[];
|
|
29
|
+
}
|
|
30
|
+
export type CoveAnswersInput = Asked;
|
|
31
|
+
export type CoveAnswersOptions = StageOptions;
|
|
32
|
+
export type CoveAnswersResult = StageOutcome<CoveAnswers>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Llm } from "@spendgraph/llms";
|
|
2
|
+
import type { PromptClient } from "@spendgraph/prompt";
|
|
3
|
+
import type { CoveQuestionsInput, CoveQuestionsOptions, CoveQuestionsResult } from "./types.js";
|
|
4
|
+
/** Stage 5A. The verification questions the answer's own claims invite. */
|
|
5
|
+
export declare function invoke(client: PromptClient, llm: Llm, input: CoveQuestionsInput, opts?: CoveQuestionsOptions): Promise<CoveQuestionsResult>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { runStage } from "../../stage.js";
|
|
2
|
+
import { COVE_QUESTIONS_SCHEMA, COVE_QUESTIONS_SLUG } from "./prompt.js";
|
|
3
|
+
/** Stage 5A. The verification questions the answer's own claims invite. */
|
|
4
|
+
export function invoke(client, llm, input, opts = {}) {
|
|
5
|
+
return runStage(client, llm, COVE_QUESTIONS_SLUG, COVE_QUESTIONS_SCHEMA, input, opts);
|
|
6
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsonSchema } from "@spendgraph/llms";
|
|
2
|
+
/** Stage 5A. Pulled by slug, so an edit needs no release here. */
|
|
3
|
+
export declare const COVE_QUESTIONS_SLUG = "ctr-5a-cove-questions-d9633d";
|
|
4
|
+
/** What the reply must be, as the prompt itself specifies it. */
|
|
5
|
+
export declare const COVE_QUESTIONS_SCHEMA: JsonSchema;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Stage 5A. Pulled by slug, so an edit needs no release here. */
|
|
2
|
+
export const COVE_QUESTIONS_SLUG = "ctr-5a-cove-questions-d9633d";
|
|
3
|
+
/** What the reply must be, as the prompt itself specifies it. */
|
|
4
|
+
export const COVE_QUESTIONS_SCHEMA = {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
questions: {
|
|
8
|
+
type: "array",
|
|
9
|
+
items: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
id: { type: "string" },
|
|
13
|
+
question: { type: "string" },
|
|
14
|
+
claim_it_tests: { type: "string" },
|
|
15
|
+
claim_type: {
|
|
16
|
+
type: "string",
|
|
17
|
+
enum: ["entity", "number", "date", "causal", "superlative", "other"],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
required: ["id", "question", "claim_it_tests", "claim_type"],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
unverifiable_claims: { type: "array", items: { type: "string" } },
|
|
24
|
+
},
|
|
25
|
+
required: ["questions", "unverifiable_claims"],
|
|
26
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Asked } from "../../context.js";
|
|
2
|
+
import type { StageOptions, StageOutcome } from "../../stage.js";
|
|
3
|
+
export type ClaimType = "entity" | "number" | "date" | "causal" | "superlative" | "other";
|
|
4
|
+
export interface VerificationQuestion {
|
|
5
|
+
id: string;
|
|
6
|
+
question: string;
|
|
7
|
+
claim_it_tests: string;
|
|
8
|
+
claim_type: ClaimType;
|
|
9
|
+
}
|
|
10
|
+
export interface CoveQuestions {
|
|
11
|
+
questions: VerificationQuestion[];
|
|
12
|
+
/** Load-bearing claims no independent question could settle. Naming them is itself a finding. */
|
|
13
|
+
unverifiable_claims: string[];
|
|
14
|
+
}
|
|
15
|
+
export type CoveQuestionsInput = Asked;
|
|
16
|
+
export type CoveQuestionsOptions = StageOptions;
|
|
17
|
+
export type CoveQuestionsResult = StageOutcome<CoveQuestions>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Llm } from "@spendgraph/llms";
|
|
2
|
+
import type { PromptClient } from "@spendgraph/prompt";
|
|
3
|
+
import type { DecomposeInput, DecomposeOptions, DecomposeResult } from "./types.js";
|
|
4
|
+
/** Stage 2. Splits the question into ordered sub-questions, and answers none. */
|
|
5
|
+
export declare function invoke(client: PromptClient, llm: Llm, input: DecomposeInput, opts?: DecomposeOptions): Promise<DecomposeResult>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { runStage } from "../../stage.js";
|
|
2
|
+
import { DECOMPOSE_SCHEMA, DECOMPOSE_SLUG } from "./prompt.js";
|
|
3
|
+
/** Stage 2. Splits the question into ordered sub-questions, and answers none. */
|
|
4
|
+
export function invoke(client, llm, input, opts = {}) {
|
|
5
|
+
return runStage(client, llm, DECOMPOSE_SLUG, DECOMPOSE_SCHEMA, input, opts);
|
|
6
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { JsonSchema } from "@spendgraph/llms";
|
|
2
|
+
/** The stored decomposition prompt. Pulled by slug, so an edit needs no release here. */
|
|
3
|
+
export declare const DECOMPOSE_SLUG = "ctr-2-decompose-b559f2";
|
|
4
|
+
/**
|
|
5
|
+
* What the reply must be, as the prompt itself specifies it.
|
|
6
|
+
*
|
|
7
|
+
* `maxItems` is 7 because the prompt caps it there, and the cap is the point:
|
|
8
|
+
* unbounded splitting — task lists breeding task lists — is the failure this
|
|
9
|
+
* stage exists to avoid.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* What each hint means, sent with the schema.
|
|
13
|
+
*
|
|
14
|
+
* Seven bare identifiers left the choice to be guessed from the name, and two of
|
|
15
|
+
* them are wired to nothing by default — a sub-question hinting `code_exec` or
|
|
16
|
+
* `get_documents` comes back skipped, so a guess between `deeprecall` and
|
|
17
|
+
* `get_documents` silently costs an answer. Saying which is which is the whole
|
|
18
|
+
* of the fix. `tests/tool-hints.test.ts` holds this text to what
|
|
19
|
+
* `DEFAULT_TOOLS` actually wires.
|
|
20
|
+
*/
|
|
21
|
+
export declare const TOOL_HINT: string;
|
|
22
|
+
export declare const DECOMPOSE_SCHEMA: JsonSchema;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** The stored decomposition prompt. Pulled by slug, so an edit needs no release here. */
|
|
2
|
+
export const DECOMPOSE_SLUG = "ctr-2-decompose-b559f2";
|
|
3
|
+
/**
|
|
4
|
+
* What the reply must be, as the prompt itself specifies it.
|
|
5
|
+
*
|
|
6
|
+
* `maxItems` is 7 because the prompt caps it there, and the cap is the point:
|
|
7
|
+
* unbounded splitting — task lists breeding task lists — is the failure this
|
|
8
|
+
* stage exists to avoid.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* What each hint means, sent with the schema.
|
|
12
|
+
*
|
|
13
|
+
* Seven bare identifiers left the choice to be guessed from the name, and two of
|
|
14
|
+
* them are wired to nothing by default — a sub-question hinting `code_exec` or
|
|
15
|
+
* `get_documents` comes back skipped, so a guess between `deeprecall` and
|
|
16
|
+
* `get_documents` silently costs an answer. Saying which is which is the whole
|
|
17
|
+
* of the fix. `tests/tool-hints.test.ts` holds this text to what
|
|
18
|
+
* `DEFAULT_TOOLS` actually wires.
|
|
19
|
+
*/
|
|
20
|
+
export const TOOL_HINT = [
|
|
21
|
+
"Which tool the executor should reach for. Name the cheapest one that can answer, and prefer none over a call that is not needed.",
|
|
22
|
+
"- none: answerable from the question and the brief alone. Nothing is called.",
|
|
23
|
+
"- calculator: arithmetic over numbers already in hand.",
|
|
24
|
+
"- deeprecall: the knowledge base. Use this for anything about stored or internal material.",
|
|
25
|
+
"- web_search: facts from the open web, and anything that may have changed recently.",
|
|
26
|
+
"- fetch_url: retrieve one page whose address is already known.",
|
|
27
|
+
"- code_exec: not wired by default. A sub-question naming it comes back unanswered, so do not name it unless the caller has said it is available.",
|
|
28
|
+
"- get_documents: not wired by default, and the same warning applies. For stored material, name deeprecall instead.",
|
|
29
|
+
].join("\n");
|
|
30
|
+
export const DECOMPOSE_SCHEMA = {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
sub_questions: {
|
|
34
|
+
type: "array",
|
|
35
|
+
minItems: 1,
|
|
36
|
+
maxItems: 7,
|
|
37
|
+
items: {
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: {
|
|
40
|
+
id: { type: "string" },
|
|
41
|
+
question: { type: "string" },
|
|
42
|
+
depends_on: { type: "array", items: { type: "string" } },
|
|
43
|
+
verify_by: { type: "string" },
|
|
44
|
+
done_when: { type: "string" },
|
|
45
|
+
kind: { type: "string", enum: ["read_only", "synthesis"] },
|
|
46
|
+
tool: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: TOOL_HINT,
|
|
49
|
+
enum: [
|
|
50
|
+
"none",
|
|
51
|
+
"calculator",
|
|
52
|
+
"code_exec",
|
|
53
|
+
"deeprecall",
|
|
54
|
+
"get_documents",
|
|
55
|
+
"web_search",
|
|
56
|
+
"fetch_url",
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
required: ["id", "question", "depends_on", "verify_by", "done_when", "kind", "tool"],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
composition: { type: "string" },
|
|
64
|
+
split_further_if: { type: "string" },
|
|
65
|
+
count: { type: "number" },
|
|
66
|
+
},
|
|
67
|
+
required: ["sub_questions", "composition", "split_further_if", "count"],
|
|
68
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Asked } from "../../context.js";
|
|
2
|
+
import type { StageOptions, StageOutcome } from "../../stage.js";
|
|
3
|
+
/** Whether a sub-question may run beside its siblings, or has to hold the pen. */
|
|
4
|
+
export type SubQuestionKind = "read_only" | "synthesis";
|
|
5
|
+
/**
|
|
6
|
+
* The tool the executor would reach for, cheapest first.
|
|
7
|
+
*
|
|
8
|
+
* A routing hint recorded here so the execution stage does not work it out
|
|
9
|
+
* again. Nothing in this stage calls anything.
|
|
10
|
+
*/
|
|
11
|
+
export type SubQuestionTool = "none" | "calculator" | "code_exec" | "deeprecall" | "get_documents" | "web_search" | "fetch_url";
|
|
12
|
+
export interface SubQuestion {
|
|
13
|
+
id: string;
|
|
14
|
+
question: string;
|
|
15
|
+
/** Ids that must be answered first. Empty when nothing blocks it. */
|
|
16
|
+
depends_on: string[];
|
|
17
|
+
/**
|
|
18
|
+
* How you would know the answer is right.
|
|
19
|
+
*
|
|
20
|
+
* Carried rather than acted on, like `done_when`: nothing in the package
|
|
21
|
+
* checks a sub-answer against it. Recorded so a stage reading the ledger — or
|
|
22
|
+
* a person reading the run — can see what the split thought would settle it.
|
|
23
|
+
*/
|
|
24
|
+
verify_by: string;
|
|
25
|
+
/** The observable condition that ends it. */
|
|
26
|
+
done_when: string;
|
|
27
|
+
kind: SubQuestionKind;
|
|
28
|
+
tool: SubQuestionTool;
|
|
29
|
+
}
|
|
30
|
+
export interface Decomposition {
|
|
31
|
+
/** At most seven, depth one. One is a valid answer. */
|
|
32
|
+
sub_questions: SubQuestion[];
|
|
33
|
+
/** How the sub-answers combine into an answer to the original question. */
|
|
34
|
+
composition: string;
|
|
35
|
+
/** The observed failure that would justify splitting further. Never speculative. */
|
|
36
|
+
split_further_if: string;
|
|
37
|
+
count: number;
|
|
38
|
+
}
|
|
39
|
+
export type DecomposeInput = Asked;
|
|
40
|
+
export type DecomposeOptions = StageOptions;
|
|
41
|
+
export type DecomposeResult = StageOutcome<Decomposition>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Llm } from "@spendgraph/llms";
|
|
2
|
+
import type { PromptClient } from "@spendgraph/prompt";
|
|
3
|
+
import type { DiscriminatingTestInput, DiscriminatingTestOptions, DiscriminatingTestResult } from "./types.js";
|
|
4
|
+
/** Stage 4B. The one test whose result tells the live hypotheses apart. */
|
|
5
|
+
export declare function invoke(client: PromptClient, llm: Llm, input: DiscriminatingTestInput, opts?: DiscriminatingTestOptions): Promise<DiscriminatingTestResult>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { runStage } from "../../stage.js";
|
|
2
|
+
import { TEST_SCHEMA, TEST_SLUG } from "./prompt.js";
|
|
3
|
+
/** Stage 4B. The one test whose result tells the live hypotheses apart. */
|
|
4
|
+
export function invoke(client, llm, input, opts = {}) {
|
|
5
|
+
return runStage(client, llm, TEST_SLUG, TEST_SCHEMA, input, opts);
|
|
6
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsonSchema } from "@spendgraph/llms";
|
|
2
|
+
/** Stage 4B. Pulled by slug, so an edit needs no release here. */
|
|
3
|
+
export declare const TEST_SLUG = "ctr-4b-discriminating-test-w92055";
|
|
4
|
+
/** What the reply must be, as the prompt itself specifies it. */
|
|
5
|
+
export declare const TEST_SCHEMA: JsonSchema;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** Stage 4B. Pulled by slug, so an edit needs no release here. */
|
|
2
|
+
export const TEST_SLUG = "ctr-4b-discriminating-test-w92055";
|
|
3
|
+
/** What the reply must be, as the prompt itself specifies it. */
|
|
4
|
+
export const TEST_SCHEMA = {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
hypotheses: {
|
|
8
|
+
type: "array",
|
|
9
|
+
items: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
id: { type: "string" },
|
|
13
|
+
statement: { type: "string" },
|
|
14
|
+
prior: { type: "number", minimum: 0, maximum: 1 },
|
|
15
|
+
is_leading: { type: "boolean" },
|
|
16
|
+
},
|
|
17
|
+
required: ["id", "statement", "prior", "is_leading"],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
chosen_test: { type: "string" },
|
|
21
|
+
tool: {
|
|
22
|
+
type: "string",
|
|
23
|
+
enum: [
|
|
24
|
+
"none",
|
|
25
|
+
"calculator",
|
|
26
|
+
"code_exec",
|
|
27
|
+
"deeprecall",
|
|
28
|
+
"get_documents",
|
|
29
|
+
"web_search",
|
|
30
|
+
"fetch_url",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
expected_result_by_hypothesis: {
|
|
34
|
+
type: "array",
|
|
35
|
+
items: {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
hypothesis_id: { type: "string" },
|
|
39
|
+
expected: { type: "string" },
|
|
40
|
+
},
|
|
41
|
+
required: ["hypothesis_id", "expected"],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
discriminating: { type: "boolean" },
|
|
45
|
+
kill_condition: { type: "string" },
|
|
46
|
+
rejected_tests: {
|
|
47
|
+
type: "array",
|
|
48
|
+
items: {
|
|
49
|
+
type: "object",
|
|
50
|
+
properties: {
|
|
51
|
+
test: { type: "string" },
|
|
52
|
+
why_rejected: { type: "string" },
|
|
53
|
+
},
|
|
54
|
+
required: ["test", "why_rejected"],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
required: [
|
|
59
|
+
"hypotheses",
|
|
60
|
+
"chosen_test",
|
|
61
|
+
"tool",
|
|
62
|
+
"expected_result_by_hypothesis",
|
|
63
|
+
"discriminating",
|
|
64
|
+
"kill_condition",
|
|
65
|
+
"rejected_tests",
|
|
66
|
+
],
|
|
67
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Asked } from "../../context.js";
|
|
2
|
+
import type { StageOptions, StageOutcome } from "../../stage.js";
|
|
3
|
+
import type { SubQuestionTool } from "../decompose/index.js";
|
|
4
|
+
export interface Hypothesis {
|
|
5
|
+
id: string;
|
|
6
|
+
statement: string;
|
|
7
|
+
/** 0.00 to 1.00, two decimals. */
|
|
8
|
+
prior: number;
|
|
9
|
+
is_leading: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ExpectedResult {
|
|
12
|
+
hypothesis_id: string;
|
|
13
|
+
expected: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RejectedTest {
|
|
16
|
+
test: string;
|
|
17
|
+
why_rejected: string;
|
|
18
|
+
}
|
|
19
|
+
export interface DiscriminatingTest {
|
|
20
|
+
hypotheses: Hypothesis[];
|
|
21
|
+
chosen_test: string;
|
|
22
|
+
/** What the executor would run it with. A routing hint; this stage runs nothing. */
|
|
23
|
+
tool: SubQuestionTool;
|
|
24
|
+
expected_result_by_hypothesis: ExpectedResult[];
|
|
25
|
+
/** False only when no discriminating test exists. */
|
|
26
|
+
discriminating: boolean;
|
|
27
|
+
kill_condition: string;
|
|
28
|
+
rejected_tests: RejectedTest[];
|
|
29
|
+
}
|
|
30
|
+
export type DiscriminatingTestInput = Asked;
|
|
31
|
+
export type DiscriminatingTestOptions = StageOptions;
|
|
32
|
+
export type DiscriminatingTestResult = StageOutcome<DiscriminatingTest>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Llm } from "@spendgraph/llms";
|
|
2
|
+
import type { PromptClient } from "@spendgraph/prompt";
|
|
3
|
+
import type { PlanCandidatesInput, PlanCandidatesOptions, PlanCandidatesResult } from "./types.js";
|
|
4
|
+
/** Stage 3A. Three approaches, the one chosen, and the steps that follow from it. */
|
|
5
|
+
export declare function invoke(client: PromptClient, llm: Llm, input: PlanCandidatesInput, opts?: PlanCandidatesOptions): Promise<PlanCandidatesResult>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { runStage } from "../../stage.js";
|
|
2
|
+
import { PLAN_SCHEMA, PLAN_SLUG } from "./prompt.js";
|
|
3
|
+
/** Stage 3A. Three approaches, the one chosen, and the steps that follow from it. */
|
|
4
|
+
export function invoke(client, llm, input, opts = {}) {
|
|
5
|
+
return runStage(client, llm, PLAN_SLUG, PLAN_SCHEMA, input, opts);
|
|
6
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsonSchema } from "@spendgraph/llms";
|
|
2
|
+
/** Stage 3A. Pulled by slug, so an edit needs no release here. */
|
|
3
|
+
export declare const PLAN_SLUG = "ctr-3a-plan-candidates-898095";
|
|
4
|
+
/** What the reply must be, as the prompt itself specifies it. */
|
|
5
|
+
export declare const PLAN_SCHEMA: JsonSchema;
|