@proposit/proposit-core 1.11.0 → 2.1.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 -1
- package/dist/cli/commands/expressions.d.ts +29 -0
- package/dist/cli/commands/expressions.d.ts.map +1 -1
- package/dist/cli/commands/expressions.js +118 -92
- package/dist/cli/commands/expressions.js.map +1 -1
- package/dist/cli/commands/parse.d.ts.map +1 -1
- package/dist/cli/commands/parse.js +27 -29
- package/dist/cli/commands/parse.js.map +1 -1
- package/dist/extensions/{ieee → citations/ieee}/citation-claim.d.ts +53 -59
- package/dist/extensions/{ieee → citations/ieee}/citation-claim.d.ts.map +1 -1
- package/dist/extensions/{ieee → citations/ieee}/citation-claim.js +2 -2
- package/dist/extensions/citations/ieee/citation-claim.js.map +1 -0
- package/dist/extensions/citations/ieee/formatting.d.ts.map +1 -0
- package/dist/extensions/{ieee → citations/ieee}/formatting.js +0 -1
- package/dist/extensions/citations/ieee/formatting.js.map +1 -0
- package/dist/extensions/citations/ieee/index.d.ts.map +1 -0
- package/dist/extensions/citations/ieee/index.js.map +1 -0
- package/dist/extensions/{ieee → citations/ieee}/references.d.ts +161 -181
- package/dist/extensions/citations/ieee/references.d.ts.map +1 -0
- package/dist/extensions/{ieee → citations/ieee}/references.js +48 -22
- package/dist/extensions/citations/ieee/references.js.map +1 -0
- package/dist/extensions/{ieee → citations/ieee}/relaxed.d.ts +159 -180
- package/dist/extensions/citations/ieee/relaxed.d.ts.map +1 -0
- package/dist/extensions/{ieee → citations/ieee}/relaxed.js +1 -4
- package/dist/extensions/{ieee → citations/ieee}/relaxed.js.map +1 -1
- package/dist/extensions/citations/ieee/segment-builder.d.ts.map +1 -0
- package/dist/extensions/citations/ieee/segment-builder.js.map +1 -0
- package/dist/extensions/{ieee → citations/ieee}/segment-templates.d.ts +0 -1
- package/dist/extensions/citations/ieee/segment-templates.d.ts.map +1 -0
- package/dist/extensions/{ieee → citations/ieee}/segment-templates.js +0 -27
- package/dist/extensions/citations/ieee/segment-templates.js.map +1 -0
- package/dist/extensions/citations/unparsed/index.d.ts +2 -0
- package/dist/extensions/citations/unparsed/index.d.ts.map +1 -0
- package/dist/extensions/citations/unparsed/index.js +2 -0
- package/dist/extensions/citations/unparsed/index.js.map +1 -0
- package/dist/extensions/citations/unparsed/unparsed-citation.d.ts +11 -0
- package/dist/extensions/citations/unparsed/unparsed-citation.d.ts.map +1 -0
- package/dist/extensions/citations/unparsed/unparsed-citation.js +22 -0
- package/dist/extensions/citations/unparsed/unparsed-citation.js.map +1 -0
- package/dist/extensions/openai/errors.d.ts +8 -0
- package/dist/extensions/openai/errors.d.ts.map +1 -1
- package/dist/extensions/openai/errors.js +58 -0
- package/dist/extensions/openai/errors.js.map +1 -1
- package/dist/extensions/openai/index.d.ts +4 -2
- package/dist/extensions/openai/index.d.ts.map +1 -1
- package/dist/extensions/openai/index.js +2 -1
- package/dist/extensions/openai/index.js.map +1 -1
- package/dist/extensions/openai/openai-http.d.ts +30 -0
- package/dist/extensions/openai/openai-http.d.ts.map +1 -0
- package/dist/extensions/openai/openai-http.js +310 -0
- package/dist/extensions/openai/openai-http.js.map +1 -0
- package/dist/extensions/openai/openai-parsing.d.ts +34 -0
- package/dist/extensions/openai/openai-parsing.d.ts.map +1 -0
- package/dist/extensions/openai/openai-parsing.js +226 -0
- package/dist/extensions/openai/openai-parsing.js.map +1 -0
- package/dist/extensions/openai/openai-retrieval.d.ts +150 -0
- package/dist/extensions/openai/openai-retrieval.d.ts.map +1 -0
- package/dist/extensions/openai/openai-retrieval.js +248 -0
- package/dist/extensions/openai/openai-retrieval.js.map +1 -0
- package/dist/extensions/openai/openai-tools.d.ts +9 -0
- package/dist/extensions/openai/openai-tools.d.ts.map +1 -0
- package/dist/extensions/openai/openai-tools.js +93 -0
- package/dist/extensions/openai/openai-tools.js.map +1 -0
- package/dist/extensions/openai/provider.d.ts +2 -149
- package/dist/extensions/openai/provider.d.ts.map +1 -1
- package/dist/extensions/openai/provider.js +5 -886
- package/dist/extensions/openai/provider.js.map +1 -1
- package/dist/extensions/openai/types.d.ts +1 -0
- package/dist/extensions/openai/types.d.ts.map +1 -1
- package/dist/extensions/openai/types.js +4 -1
- package/dist/extensions/openai/types.js.map +1 -1
- package/dist/extensions/{argument-ingestion/shared → pipelines/base}/basics-extension.d.ts +1 -1
- package/dist/extensions/pipelines/base/basics-extension.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion/shared → pipelines/base}/basics-extension.js +5 -4
- package/dist/extensions/pipelines/base/basics-extension.js.map +1 -0
- package/dist/extensions/pipelines/base/finalize-response-v2.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion/shared → pipelines/base}/finalize-response-v2.js +19 -3
- package/dist/extensions/pipelines/base/finalize-response-v2.js.map +1 -0
- package/dist/extensions/pipelines/base/index.d.ts +9 -0
- package/dist/extensions/pipelines/base/index.d.ts.map +1 -0
- package/dist/extensions/pipelines/base/index.js +17 -0
- package/dist/extensions/pipelines/base/index.js.map +1 -0
- package/dist/extensions/pipelines/base/resolve-llm-stage-options.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion/shared → pipelines/base}/resolve-llm-stage-options.js +2 -2
- package/dist/extensions/pipelines/base/resolve-llm-stage-options.js.map +1 -0
- package/dist/extensions/pipelines/base/role-derivation.d.ts.map +1 -0
- package/dist/extensions/pipelines/base/role-derivation.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/axiom-indicator-detection.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/axiom-indicator-detection.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/axiom-indicator-detection.js +1 -1
- package/dist/extensions/pipelines/base/stages/axiom-indicator-detection.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/citation-source-detection.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/citation-source-detection.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/citation-source-detection.js +1 -1
- package/dist/extensions/pipelines/base/stages/citation-source-detection.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-canonicalization.d.ts +20 -3
- package/dist/extensions/pipelines/base/stages/claim-canonicalization.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-canonicalization.js +20 -6
- package/dist/extensions/pipelines/base/stages/claim-canonicalization.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-mention-extraction.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/claim-mention-extraction.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-mention-extraction.js +1 -1
- package/dist/extensions/pipelines/base/stages/claim-mention-extraction.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-reference-validation.d.ts +1 -1
- package/dist/extensions/pipelines/base/stages/claim-reference-validation.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-reference-validation.js +1 -1
- package/dist/extensions/pipelines/base/stages/claim-reference-validation.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-type-classification.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/claim-type-classification.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-type-classification.js +2 -2
- package/dist/extensions/pipelines/base/stages/claim-type-classification.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/conclusion-selection.d.ts +21 -3
- package/dist/extensions/pipelines/base/stages/conclusion-selection.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/conclusion-selection.js +8 -2
- package/dist/extensions/pipelines/base/stages/conclusion-selection.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/formula-compilation.d.ts +1 -1
- package/dist/extensions/pipelines/base/stages/formula-compilation.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/formula-compilation.js +1 -1
- package/dist/extensions/pipelines/base/stages/formula-compilation.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/formula-validation.d.ts +1 -1
- package/dist/extensions/pipelines/base/stages/formula-validation.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/formula-validation.js +2 -2
- package/dist/extensions/pipelines/base/stages/formula-validation.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/index.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/index.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/index.js +5 -3
- package/dist/extensions/pipelines/base/stages/index.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/relation-extraction.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/relation-extraction.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/relation-extraction.js +1 -1
- package/dist/extensions/pipelines/base/stages/relation-extraction.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/schemas.d.ts +2 -0
- package/dist/extensions/pipelines/base/stages/schemas.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/schemas.js +8 -0
- package/dist/extensions/pipelines/base/stages/schemas.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/segmentation.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/segmentation.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/segmentation.js +2 -2
- package/dist/extensions/pipelines/base/stages/segmentation.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/variable-assignment.d.ts +1 -1
- package/dist/extensions/pipelines/base/stages/variable-assignment.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/variable-assignment.js +1 -1
- package/dist/extensions/pipelines/base/stages/variable-assignment.js.map +1 -0
- package/dist/extensions/pipelines/base/types.d.ts.map +1 -0
- package/dist/extensions/pipelines/base/types.js +15 -0
- package/dist/extensions/pipelines/base/types.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/index.d.ts +5 -0
- package/dist/extensions/pipelines/ingestion/index.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/index.js +5 -0
- package/dist/extensions/pipelines/ingestion/index.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scholar/index.d.ts +3 -0
- package/dist/extensions/pipelines/ingestion/scholar/index.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scholar/index.js +3 -0
- package/dist/extensions/pipelines/ingestion/scholar/index.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scholar/scholar.d.ts +48 -0
- package/dist/extensions/pipelines/ingestion/scholar/scholar.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion/v2-multi-stage.js → pipelines/ingestion/scholar/scholar.js} +25 -18
- package/dist/extensions/pipelines/ingestion/scholar/scholar.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts +33 -0
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js +103 -0
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/index.d.ts +3 -0
- package/dist/extensions/pipelines/ingestion/scribe/index.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/index.js +3 -0
- package/dist/extensions/pipelines/ingestion/scribe/index.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/schemas.d.ts +17 -0
- package/dist/extensions/pipelines/ingestion/scribe/schemas.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/schemas.js +26 -0
- package/dist/extensions/pipelines/ingestion/scribe/schemas.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/scribe.d.ts +20 -0
- package/dist/extensions/pipelines/ingestion/scribe/scribe.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/scribe.js +81 -0
- package/dist/extensions/pipelines/ingestion/scribe/scribe.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.d.ts +30 -0
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.js +142 -0
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.js.map +1 -0
- package/dist/lib/core/premise-engine.d.ts +15 -0
- package/dist/lib/core/premise-engine.d.ts.map +1 -1
- package/dist/lib/core/premise-engine.js +62 -127
- package/dist/lib/core/premise-engine.js.map +1 -1
- package/dist/lib/index.d.ts +1 -3
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +8 -6
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/parsing/prompt-builder.d.ts.map +1 -1
- package/dist/lib/parsing/prompt-builder.js +14 -3
- package/dist/lib/parsing/prompt-builder.js.map +1 -1
- package/dist/lib/pipelines/debug-log.js +1 -1
- package/dist/lib/pipelines/debug-log.js.map +1 -1
- package/dist/lib/pipelines/index.d.ts +1 -1
- package/dist/lib/pipelines/index.d.ts.map +1 -1
- package/dist/lib/pipelines/index.js +1 -1
- package/dist/lib/pipelines/index.js.map +1 -1
- package/dist/lib/pipelines/stage-helpers.d.ts +9 -0
- package/dist/lib/pipelines/stage-helpers.d.ts.map +1 -1
- package/dist/lib/pipelines/stage-helpers.js +11 -0
- package/dist/lib/pipelines/stage-helpers.js.map +1 -1
- package/package.json +20 -5
- package/dist/extensions/argument-ingestion/index.d.ts +0 -15
- package/dist/extensions/argument-ingestion/index.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/index.js +0 -17
- package/dist/extensions/argument-ingestion/index.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/basics-extension.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/basics-extension.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/finalize-response-v2.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/finalize-response-v2.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/finalize-response.d.ts +0 -21
- package/dist/extensions/argument-ingestion/shared/finalize-response.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/finalize-response.js +0 -33
- package/dist/extensions/argument-ingestion/shared/finalize-response.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/resolve-llm-stage-options.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/resolve-llm-stage-options.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/role-derivation.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/role-derivation.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/types.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/types.js +0 -16
- package/dist/extensions/argument-ingestion/shared/types.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/citation-source-detection.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/citation-source-detection.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-canonicalization.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-canonicalization.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-reference-validation.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-reference-validation.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-type-classification.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-type-classification.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/conclusion-selection.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/conclusion-selection.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/formula-compilation.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/formula-compilation.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/formula-validation.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/formula-validation.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/index.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/index.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/relation-extraction.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/relation-extraction.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/schemas.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/schemas.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/segmentation.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/segmentation.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/variable-assignment.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/variable-assignment.js.map +0 -1
- package/dist/extensions/argument-ingestion/v1-single-shot.d.ts +0 -26
- package/dist/extensions/argument-ingestion/v1-single-shot.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/v1-single-shot.js +0 -113
- package/dist/extensions/argument-ingestion/v1-single-shot.js.map +0 -1
- package/dist/extensions/argument-ingestion/v2-multi-stage.d.ts +0 -38
- package/dist/extensions/argument-ingestion/v2-multi-stage.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/v2-multi-stage.js.map +0 -1
- package/dist/extensions/ieee/citation-claim.js.map +0 -1
- package/dist/extensions/ieee/formatting.d.ts.map +0 -1
- package/dist/extensions/ieee/formatting.js.map +0 -1
- package/dist/extensions/ieee/index.d.ts.map +0 -1
- package/dist/extensions/ieee/index.js.map +0 -1
- package/dist/extensions/ieee/references.d.ts.map +0 -1
- package/dist/extensions/ieee/references.js.map +0 -1
- package/dist/extensions/ieee/relaxed.d.ts.map +0 -1
- package/dist/extensions/ieee/segment-builder.d.ts.map +0 -1
- package/dist/extensions/ieee/segment-builder.js.map +0 -1
- package/dist/extensions/ieee/segment-templates.d.ts.map +0 -1
- package/dist/extensions/ieee/segment-templates.js.map +0 -1
- /package/dist/extensions/{ieee → citations/ieee}/formatting.d.ts +0 -0
- /package/dist/extensions/{ieee → citations/ieee}/index.d.ts +0 -0
- /package/dist/extensions/{ieee → citations/ieee}/index.js +0 -0
- /package/dist/extensions/{ieee → citations/ieee}/segment-builder.d.ts +0 -0
- /package/dist/extensions/{ieee → citations/ieee}/segment-builder.js +0 -0
- /package/dist/extensions/{argument-ingestion/shared → pipelines/base}/finalize-response-v2.d.ts +0 -0
- /package/dist/extensions/{argument-ingestion/shared → pipelines/base}/resolve-llm-stage-options.d.ts +0 -0
- /package/dist/extensions/{argument-ingestion/shared → pipelines/base}/role-derivation.d.ts +0 -0
- /package/dist/extensions/{argument-ingestion/shared → pipelines/base}/role-derivation.js +0 -0
- /package/dist/extensions/{argument-ingestion/shared → pipelines/base}/types.d.ts +0 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { TLlmRequest } from "../../lib/llm/types.js";
|
|
2
|
+
import { type TOpenAiFetch } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The status values the OpenAI Responses API reports for a stored
|
|
5
|
+
* response. `completed` / `failed` / `incomplete` / `cancelled` are
|
|
6
|
+
* terminal; `queued` / `in_progress` are transient.
|
|
7
|
+
*/
|
|
8
|
+
export type TResponseStatus = "queued" | "in_progress" | "completed" | "failed" | "incomplete" | "cancelled";
|
|
9
|
+
/**
|
|
10
|
+
* The structured result of a `retrieveResponse` call. All fields
|
|
11
|
+
* except `status` and `rawResponseId` are absent for non-terminal
|
|
12
|
+
* or failed responses.
|
|
13
|
+
*/
|
|
14
|
+
export type TRetrievedResponse = {
|
|
15
|
+
/** Current status of the stored response. */
|
|
16
|
+
status: TResponseStatus;
|
|
17
|
+
/**
|
|
18
|
+
* Parsed text output, present when `status === "completed"` and
|
|
19
|
+
* the response carried a `message` output item.
|
|
20
|
+
*/
|
|
21
|
+
output?: string;
|
|
22
|
+
/** Token usage reported by OpenAI, when available. */
|
|
23
|
+
tokenUsage?: import("../../lib/llm/types.js").TLlmTokenUsage;
|
|
24
|
+
/** The OpenAI response id that was retrieved. */
|
|
25
|
+
rawResponseId: string;
|
|
26
|
+
/**
|
|
27
|
+
* The envelope's `incomplete_details.reason`, present when
|
|
28
|
+
* `status === "incomplete"` (e.g. `max_output_tokens`,
|
|
29
|
+
* `content_filter`). Lets a completion-side consumer classify an
|
|
30
|
+
* incomplete response without re-deriving it. Additive (since
|
|
31
|
+
* v1.11.0).
|
|
32
|
+
*/
|
|
33
|
+
incompleteReason?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The envelope's `error.message`, present when `status === "failed"`.
|
|
36
|
+
* Additive (since v1.11.0).
|
|
37
|
+
*/
|
|
38
|
+
errorMessage?: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Retrieve a stored OpenAI response by id. Surfaces the current
|
|
42
|
+
* status, output text (when completed), and token usage.
|
|
43
|
+
*
|
|
44
|
+
* Throws {@link ResponseNotFoundError} when the response is not found
|
|
45
|
+
* (HTTP 404), which typically means the ~10-minute retention window
|
|
46
|
+
* has elapsed. Callers should clear the stored id, settle the
|
|
47
|
+
* associated stage as failed, and surface a retry prompt.
|
|
48
|
+
*
|
|
49
|
+
* @param id - The OpenAI response id to retrieve.
|
|
50
|
+
* @param options - Provider configuration (apiKey, optional baseUrl and fetch).
|
|
51
|
+
*/
|
|
52
|
+
export declare function retrieveResponse(id: string, options: {
|
|
53
|
+
apiKey: string;
|
|
54
|
+
baseUrl?: string;
|
|
55
|
+
fetch?: TOpenAiFetch;
|
|
56
|
+
signal?: AbortSignal;
|
|
57
|
+
}): Promise<TRetrievedResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* Reconnect to a stored, still-generating background response and
|
|
60
|
+
* **stream it to completion**. This is what actually drives a dropped
|
|
61
|
+
* background response forward: a passive `retrieveResponse` GET only
|
|
62
|
+
* reads the current state and leaves a `queued` / `in_progress`
|
|
63
|
+
* response sitting where it is, whereas reconnecting with `stream=true`
|
|
64
|
+
* resumes consumption so the response reaches a terminal status.
|
|
65
|
+
*
|
|
66
|
+
* Issues `GET /responses/{id}?stream=true&starting_after=<cursor>` and
|
|
67
|
+
* consumes the SSE stream to its terminal event, returning the same
|
|
68
|
+
* {@link TRetrievedResponse} shape as {@link retrieveResponse}.
|
|
69
|
+
*
|
|
70
|
+
* Throws {@link ResponseNotFoundError} when the response is not found
|
|
71
|
+
* (HTTP 404 — typically the ~10-minute retention window elapsed).
|
|
72
|
+
* Honors `signal`: an abort propagates as an `AbortError` from the
|
|
73
|
+
* underlying stream read.
|
|
74
|
+
*
|
|
75
|
+
* @param id - The OpenAI response id to reconnect to.
|
|
76
|
+
* @param options - `apiKey`, optional `startingAfter` SSE cursor
|
|
77
|
+
* (defaults to 0 — replay from the start of the stored stream),
|
|
78
|
+
* optional `baseUrl`, `fetch`, and `signal`.
|
|
79
|
+
*/
|
|
80
|
+
export declare function reconnectStream(id: string, options: {
|
|
81
|
+
apiKey: string;
|
|
82
|
+
startingAfter?: number;
|
|
83
|
+
baseUrl?: string;
|
|
84
|
+
fetch?: TOpenAiFetch;
|
|
85
|
+
signal?: AbortSignal;
|
|
86
|
+
}): Promise<TRetrievedResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Cancel a stored, in-flight OpenAI response. Issues
|
|
89
|
+
* `POST /responses/{id}/cancel` and returns the resulting
|
|
90
|
+
* {@link TRetrievedResponse} (typically `status: "cancelled"`).
|
|
91
|
+
*
|
|
92
|
+
* Cancel is **idempotent** per the Responses API: cancelling twice, or
|
|
93
|
+
* cancelling an already-terminal response, simply returns the final
|
|
94
|
+
* `Response` object rather than erroring — so callers do not need to
|
|
95
|
+
* guard against double-cancel.
|
|
96
|
+
*
|
|
97
|
+
* Throws {@link ResponseNotFoundError} when the response is not found
|
|
98
|
+
* (HTTP 404 — typically the ~10-minute retention window elapsed).
|
|
99
|
+
* Honors `signal` (an abort propagates as an `AbortError`).
|
|
100
|
+
*
|
|
101
|
+
* Use this to stop an in-flight background response when a stage is
|
|
102
|
+
* abandoned (resync timeout) or an import is cancelled, so generation
|
|
103
|
+
* does not keep running (and billing) server-side after the consumer
|
|
104
|
+
* has given up on it.
|
|
105
|
+
*
|
|
106
|
+
* @param id - The OpenAI response id to cancel.
|
|
107
|
+
* @param options - `apiKey`, optional `baseUrl`, `fetch`, and `signal`.
|
|
108
|
+
*/
|
|
109
|
+
export declare function cancelResponse(id: string, options: {
|
|
110
|
+
apiKey: string;
|
|
111
|
+
baseUrl?: string;
|
|
112
|
+
fetch?: TOpenAiFetch;
|
|
113
|
+
signal?: AbortSignal;
|
|
114
|
+
}): Promise<TRetrievedResponse>;
|
|
115
|
+
/**
|
|
116
|
+
* Submit a background OpenAI response and return its `responseId` +
|
|
117
|
+
* submit-time `status` **without polling or streaming to completion**.
|
|
118
|
+
*
|
|
119
|
+
* This is the submit-only half of the existing `backgroundMode`
|
|
120
|
+
* (`runBackground`): it POSTs `{ background: true, store: true }`, parses
|
|
121
|
+
* the submit envelope, and returns immediately — the caller drives the
|
|
122
|
+
* response to completion later via {@link retrieveResponse} (typically
|
|
123
|
+
* after a durable suspend keyed on the returned `responseId`). It is the
|
|
124
|
+
* provider capability the pipeline's `launchStage` needs.
|
|
125
|
+
*
|
|
126
|
+
* **Terminal-on-submit fast-path:** a small/cached request can come back
|
|
127
|
+
* already terminal (`completed`/`failed`/`incomplete`/`cancelled`) on the
|
|
128
|
+
* submit POST. This function still returns `{ responseId, status }` for
|
|
129
|
+
* that case (no throw, no poll); the caller proceeds to
|
|
130
|
+
* `retrieveResponse(responseId)`, which sees the terminal state
|
|
131
|
+
* immediately.
|
|
132
|
+
*
|
|
133
|
+
* **No-tools precondition:** background mode does not support function
|
|
134
|
+
* tools in V1 — a tool-bearing request throws {@link NonRetryableLlmError},
|
|
135
|
+
* matching `respond`'s background guard.
|
|
136
|
+
*
|
|
137
|
+
* @param req - The structured-output request (system/user prompts +
|
|
138
|
+
* `outputSchema` + model knobs). Tools are rejected.
|
|
139
|
+
* @param options - `apiKey`, optional `baseUrl`, `fetch`, and `signal`.
|
|
140
|
+
*/
|
|
141
|
+
export declare function submitBackgroundResponse<T>(req: TLlmRequest<T>, options: {
|
|
142
|
+
apiKey: string;
|
|
143
|
+
baseUrl?: string;
|
|
144
|
+
fetch?: TOpenAiFetch;
|
|
145
|
+
signal?: AbortSignal;
|
|
146
|
+
}): Promise<{
|
|
147
|
+
responseId: string;
|
|
148
|
+
status: TResponseStatus;
|
|
149
|
+
}>;
|
|
150
|
+
//# sourceMappingURL=openai-retrieval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-retrieval.d.ts","sourceRoot":"","sources":["../../../src/extensions/openai/openai-retrieval.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAqBzD,OAAO,EAEH,KAAK,YAAY,EAGpB,MAAM,YAAY,CAAA;AAInB;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACrB,QAAQ,GACR,aAAa,GACb,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,WAAW,CAAA;AAEjB;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC7B,6CAA6C;IAC7C,MAAM,EAAE,eAAe,CAAA;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,wBAAwB,EAAE,cAAc,CAAA;IAC5D,iDAAiD;IACjD,aAAa,EAAE,MAAM,CAAA;IACrB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAClC,EAAE,E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enAI Responses: retrieve a stored
|
|
2
|
+
// response by id, reconnect-and-stream a dropped background response to
|
|
3
|
+
// completion, cancel an in-flight response, and submit a background
|
|
4
|
+
// response without polling. These are the resync surfaces a consumer
|
|
5
|
+
// drives after a durable suspend.
|
|
6
|
+
//
|
|
7
|
+
// Layering: this module sits alongside `provider.ts` (neither imports
|
|
8
|
+
// the other) and above `openai-http.ts` / `openai-parsing.ts`, from
|
|
9
|
+
// which it consumes the transport and parsing helpers.
|
|
10
|
+
import { callOnce, getResponseById, parseJsonOrThrowTransient, resolveFetch, } from "./openai-http.js";
|
|
11
|
+
import { extractAssistantText, extractUsage, isAbortError, readSseEnvelope, } from "./openai-parsing.js";
|
|
12
|
+
import { deriveSchemaName } from "./openai-tools.js";
|
|
13
|
+
import { typeboxToOpenAiSchema } from "./structured-output.js";
|
|
14
|
+
import { classifyHttpError, NonRetryableLlmError, ResponseNotFoundError, TransientLlmError, } from "./errors.js";
|
|
15
|
+
import { DEFAULT_BASE_URL, } from "./types.js";
|
|
16
|
+
/**
|
|
17
|
+
* Retrieve a stored OpenAI response by id. Surfaces the current
|
|
18
|
+
* status, output text (when completed), and token usage.
|
|
19
|
+
*
|
|
20
|
+
* Throws {@link ResponseNotFoundError} when the response is not found
|
|
21
|
+
* (HTTP 404), which typically means the ~10-minute retention window
|
|
22
|
+
* has elapsed. Callers should clear the stored id, settle the
|
|
23
|
+
* associated stage as failed, and surface a retry prompt.
|
|
24
|
+
*
|
|
25
|
+
* @param id - The OpenAI response id to retrieve.
|
|
26
|
+
* @param options - Provider configuration (apiKey, optional baseUrl and fetch).
|
|
27
|
+
*/
|
|
28
|
+
export async function retrieveResponse(id, options) {
|
|
29
|
+
const fetchImpl = resolveFetch(options.fetch, "retrieveResponse");
|
|
30
|
+
const envelope = await getResponseById({
|
|
31
|
+
url: options.baseUrl ?? DEFAULT_BASE_URL,
|
|
32
|
+
id,
|
|
33
|
+
apiKey: options.apiKey,
|
|
34
|
+
fetchImpl,
|
|
35
|
+
signal: options.signal,
|
|
36
|
+
});
|
|
37
|
+
return envelopeToRetrievedResponse(envelope, id);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Reconnect to a stored, still-generating background response and
|
|
41
|
+
* **stream it to completion**. This is what actually drives a dropped
|
|
42
|
+
* background response forward: a passive `retrieveResponse` GET only
|
|
43
|
+
* reads the current state and leaves a `queued` / `in_progress`
|
|
44
|
+
* response sitting where it is, whereas reconnecting with `stream=true`
|
|
45
|
+
* resumes consumption so the response reaches a terminal status.
|
|
46
|
+
*
|
|
47
|
+
* Issues `GET /responses/{id}?stream=true&starting_after=<cursor>` and
|
|
48
|
+
* consumes the SSE stream to its terminal event, returning the same
|
|
49
|
+
* {@link TRetrievedResponse} shape as {@link retrieveResponse}.
|
|
50
|
+
*
|
|
51
|
+
* Throws {@link ResponseNotFoundError} when the response is not found
|
|
52
|
+
* (HTTP 404 — typically the ~10-minute retention window elapsed).
|
|
53
|
+
* Honors `signal`: an abort propagates as an `AbortError` from the
|
|
54
|
+
* underlying stream read.
|
|
55
|
+
*
|
|
56
|
+
* @param id - The OpenAI response id to reconnect to.
|
|
57
|
+
* @param options - `apiKey`, optional `startingAfter` SSE cursor
|
|
58
|
+
* (defaults to 0 — replay from the start of the stored stream),
|
|
59
|
+
* optional `baseUrl`, `fetch`, and `signal`.
|
|
60
|
+
*/
|
|
61
|
+
export async function reconnectStream(id, options) {
|
|
62
|
+
const fetchImpl = resolveFetch(options.fetch, "reconnectStream");
|
|
63
|
+
const baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
64
|
+
const startingAfter = options.startingAfter ?? 0;
|
|
65
|
+
const url = `${baseUrl}/${id}?stream=true&starting_after=${startingAfter.toString()}`;
|
|
66
|
+
let response;
|
|
67
|
+
try {
|
|
68
|
+
response = await fetchImpl(url, {
|
|
69
|
+
method: "GET",
|
|
70
|
+
headers: { Authorization: `Bearer ${options.apiKey}` },
|
|
71
|
+
signal: options.signal,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
if (isAbortError(err))
|
|
76
|
+
throw err;
|
|
77
|
+
throw new TransientLlmError({
|
|
78
|
+
message: `Network error reconnecting to OpenAI background response: ${err instanceof Error ? err.message : String(err)}`,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
if (response.status === 404) {
|
|
82
|
+
throw new ResponseNotFoundError({ responseId: id });
|
|
83
|
+
}
|
|
84
|
+
if (!response.ok) {
|
|
85
|
+
const errorBody = await response.text().catch(() => "");
|
|
86
|
+
throw classifyHttpError(response.status, `OpenAI reconnect ${response.status.toString()}: ${errorBody || response.statusText}`);
|
|
87
|
+
}
|
|
88
|
+
const envelope = await readSseEnvelope(response);
|
|
89
|
+
return envelopeToRetrievedResponse(envelope, id);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Cancel a stored, in-flight OpenAI response. Issues
|
|
93
|
+
* `POST /responses/{id}/cancel` and returns the resulting
|
|
94
|
+
* {@link TRetrievedResponse} (typically `status: "cancelled"`).
|
|
95
|
+
*
|
|
96
|
+
* Cancel is **idempotent** per the Responses API: cancelling twice, or
|
|
97
|
+
* cancelling an already-terminal response, simply returns the final
|
|
98
|
+
* `Response` object rather than erroring — so callers do not need to
|
|
99
|
+
* guard against double-cancel.
|
|
100
|
+
*
|
|
101
|
+
* Throws {@link ResponseNotFoundError} when the response is not found
|
|
102
|
+
* (HTTP 404 — typically the ~10-minute retention window elapsed).
|
|
103
|
+
* Honors `signal` (an abort propagates as an `AbortError`).
|
|
104
|
+
*
|
|
105
|
+
* Use this to stop an in-flight background response when a stage is
|
|
106
|
+
* abandoned (resync timeout) or an import is cancelled, so generation
|
|
107
|
+
* does not keep running (and billing) server-side after the consumer
|
|
108
|
+
* has given up on it.
|
|
109
|
+
*
|
|
110
|
+
* @param id - The OpenAI response id to cancel.
|
|
111
|
+
* @param options - `apiKey`, optional `baseUrl`, `fetch`, and `signal`.
|
|
112
|
+
*/
|
|
113
|
+
export async function cancelResponse(id, options) {
|
|
114
|
+
const fetchImpl = resolveFetch(options.fetch, "cancelResponse");
|
|
115
|
+
const baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
116
|
+
let response;
|
|
117
|
+
try {
|
|
118
|
+
response = await fetchImpl(`${baseUrl}/${id}/cancel`, {
|
|
119
|
+
method: "POST",
|
|
120
|
+
headers: { Authorization: `Bearer ${options.apiKey}` },
|
|
121
|
+
signal: options.signal,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
if (isAbortError(err))
|
|
126
|
+
throw err;
|
|
127
|
+
throw new TransientLlmError({
|
|
128
|
+
message: `Network error cancelling OpenAI background response: ${err instanceof Error ? err.message : String(err)}`,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
if (response.status === 404) {
|
|
132
|
+
throw new ResponseNotFoundError({ responseId: id });
|
|
133
|
+
}
|
|
134
|
+
if (!response.ok) {
|
|
135
|
+
const errorBody = await response.text().catch(() => "");
|
|
136
|
+
throw classifyHttpError(response.status, `OpenAI cancel ${response.status.toString()}: ${errorBody || response.statusText}`);
|
|
137
|
+
}
|
|
138
|
+
const envelope = await parseJsonOrThrowTransient(response, "OpenAI cancel body was not valid JSON");
|
|
139
|
+
return envelopeToRetrievedResponse(envelope, id);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Submit a background OpenAI response and return its `responseId` +
|
|
143
|
+
* submit-time `status` **without polling or streaming to completion**.
|
|
144
|
+
*
|
|
145
|
+
* This is the submit-only half of the existing `backgroundMode`
|
|
146
|
+
* (`runBackground`): it POSTs `{ background: true, store: true }`, parses
|
|
147
|
+
* the submit envelope, and returns immediately — the caller drives the
|
|
148
|
+
* response to completion later via {@link retrieveResponse} (typically
|
|
149
|
+
* after a durable suspend keyed on the returned `responseId`). It is the
|
|
150
|
+
* provider capability the pipeline's `launchStage` needs.
|
|
151
|
+
*
|
|
152
|
+
* **Terminal-on-submit fast-path:** a small/cached request can come back
|
|
153
|
+
* already terminal (`completed`/`failed`/`incomplete`/`cancelled`) on the
|
|
154
|
+
* submit POST. This function still returns `{ responseId, status }` for
|
|
155
|
+
* that case (no throw, no poll); the caller proceeds to
|
|
156
|
+
* `retrieveResponse(responseId)`, which sees the terminal state
|
|
157
|
+
* immediately.
|
|
158
|
+
*
|
|
159
|
+
* **No-tools precondition:** background mode does not support function
|
|
160
|
+
* tools in V1 — a tool-bearing request throws {@link NonRetryableLlmError},
|
|
161
|
+
* matching `respond`'s background guard.
|
|
162
|
+
*
|
|
163
|
+
* @param req - The structured-output request (system/user prompts +
|
|
164
|
+
* `outputSchema` + model knobs). Tools are rejected.
|
|
165
|
+
* @param options - `apiKey`, optional `baseUrl`, `fetch`, and `signal`.
|
|
166
|
+
*/
|
|
167
|
+
export async function submitBackgroundResponse(req, options) {
|
|
168
|
+
if (req.tools && req.tools.length > 0) {
|
|
169
|
+
throw new NonRetryableLlmError({
|
|
170
|
+
message: "OpenAI background mode does not support function tools in V1. Disable backgroundMode / backgroundStreamMode for tool-using requests, or run the tools synchronously.",
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
const fetchImpl = resolveFetch(options.fetch, "submitBackgroundResponse");
|
|
174
|
+
const baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
175
|
+
const schemaName = deriveSchemaName(req.outputSchema);
|
|
176
|
+
const convertedSchema = typeboxToOpenAiSchema(req.outputSchema);
|
|
177
|
+
const body = {
|
|
178
|
+
model: req.model,
|
|
179
|
+
input: [
|
|
180
|
+
{ role: "system", content: req.systemPrompt },
|
|
181
|
+
{ role: "user", content: req.userMessage },
|
|
182
|
+
],
|
|
183
|
+
text: {
|
|
184
|
+
format: {
|
|
185
|
+
type: "json_schema",
|
|
186
|
+
name: schemaName,
|
|
187
|
+
strict: true,
|
|
188
|
+
schema: convertedSchema,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
background: true,
|
|
192
|
+
store: true,
|
|
193
|
+
};
|
|
194
|
+
if (req.maxOutputTokens !== undefined) {
|
|
195
|
+
body.max_output_tokens = req.maxOutputTokens;
|
|
196
|
+
}
|
|
197
|
+
if (req.reasoningEffort) {
|
|
198
|
+
body.reasoning = { effort: req.reasoningEffort };
|
|
199
|
+
}
|
|
200
|
+
const submit = await callOnce({
|
|
201
|
+
url: baseUrl,
|
|
202
|
+
apiKey: options.apiKey,
|
|
203
|
+
body,
|
|
204
|
+
fetchImpl,
|
|
205
|
+
signal: req.signal ?? options.signal,
|
|
206
|
+
});
|
|
207
|
+
const submitEnvelope = await parseJsonOrThrowTransient(submit, "OpenAI background submit body was not valid JSON");
|
|
208
|
+
const id = submitEnvelope.id;
|
|
209
|
+
if (!id) {
|
|
210
|
+
throw new TransientLlmError({
|
|
211
|
+
message: "OpenAI background submit returned no response id.",
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
// Return at submit — including the terminal-on-submit fast-path. Unlike
|
|
215
|
+
// `runBackground`, a `cancelled` submit envelope is NOT thrown here: the
|
|
216
|
+
// submit-only contract returns every terminal status, and the caller's
|
|
217
|
+
// completion step classifies it (a cancelled response settles as a skip).
|
|
218
|
+
return {
|
|
219
|
+
responseId: id,
|
|
220
|
+
status: (submitEnvelope.status ?? "queued"),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function envelopeToRetrievedResponse(envelope, id) {
|
|
224
|
+
const output = extractAssistantText(envelope.output);
|
|
225
|
+
const usage = extractUsage(envelope);
|
|
226
|
+
const result = {
|
|
227
|
+
status: (envelope.status ?? "in_progress"),
|
|
228
|
+
rawResponseId: envelope.id ?? id,
|
|
229
|
+
};
|
|
230
|
+
if (output !== undefined) {
|
|
231
|
+
result.output = output;
|
|
232
|
+
}
|
|
233
|
+
if (usage.input > 0 || usage.output > 0) {
|
|
234
|
+
result.tokenUsage = usage;
|
|
235
|
+
}
|
|
236
|
+
// Surface the incomplete reason / error message so a completion-side
|
|
237
|
+
// consumer (e.g. `completeStage`) can classify the outcome.
|
|
238
|
+
const incompleteReason = envelope.incomplete_details?.reason;
|
|
239
|
+
if (incompleteReason !== undefined) {
|
|
240
|
+
result.incompleteReason = incompleteReason;
|
|
241
|
+
}
|
|
242
|
+
const errorMessage = envelope.error?.message;
|
|
243
|
+
if (errorMessage !== undefined) {
|
|
244
|
+
result.errorMessage = errorMessage;
|
|
245
|
+
}
|
|
246
|
+
return result;
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=openai-retrieval.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-retrieval.js","sourceRoot":"","sources":["../../../src/extensions/openai/openai-retrieval.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,wEAAwE;AACxE,oEAAoE;AACpE,qEAAqE;AACrE,kCAAkC;AAClC,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,uDAAuD;AAGvD,OAAO,EACH,QAAQ,EACR,eAAe,EACf,yBAAyB,EACzB,YAAY,GACf,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACH,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,eAAe,GAClB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EACH,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,GACpB,MAAM,aAAa,CAAA;AACpB,OAAO,EACH,gBAAgB,GAInB,MAAM,YAAY,CAAA;AAiDnB;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAClC,EAAU,EACV,OAKC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAA;IACjE,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC;QACnC,GAAG,EAAE,OAAO,CAAC,OAAO,IAAI,gBAA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,MAAM,IAAI,QAAQ,CAAoB;KACjE,CAAA;AACL,CAAC;AAED,SAAS,2BAA2B,CAChC,QAAkC,EAClC,EAAU;IAEV,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACpD,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;IACpC,MAAM,MAAM,GAAuB;QAC/B,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,IAAI,aAAa,CAAoB;QAC7D,aAAa,EAAE,QAAQ,CAAC,EAAE,IAAI,EAAE;KACnC,CAAA;IACD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;IAC1B,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,UAAU,GAAG,KAAK,CAAA;IAC7B,CAAC;IACD,qEAAqE;IACrE,4DAA4D;IAC5D,MAAM,gBAAgB,GAAG,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;IAC5D,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;IAC9C,CAAC;IACD,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IAC5C,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,CAAC,YAAY,GAAG,YAAY,CAAA;IACtC,CAAC;IACD,OAAO,MAAM,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TSchema } from "typebox";
|
|
2
|
+
import type { TToolSpec } from "../../lib/llm/types.js";
|
|
3
|
+
import type { TOpenAiTool } from "./types.js";
|
|
4
|
+
export declare function translateTools(tools: readonly TToolSpec[]): TOpenAiTool[];
|
|
5
|
+
export declare function findFunctionHandler(tools: readonly TToolSpec[] | undefined, name: string): Extract<TToolSpec, {
|
|
6
|
+
kind: "function";
|
|
7
|
+
}> | undefined;
|
|
8
|
+
export declare function deriveSchemaName(schema: TSchema): string;
|
|
9
|
+
//# sourceMappingURL=openai-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-tools.d.ts","sourceRoot":"","sources":["../../../src/extensions/openai/openai-tools.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAI7C,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,WAAW,EAAE,CAiCzE;AAED,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EACvC,IAAI,EAAE,MAAM,GACb,OAAO,CAAC,SAAS,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,GAAG,SAAS,CAQtD;AAID,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAOxD"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Translation of the framework's `TToolSpec` discriminated union into
|
|
2
|
+
// the OpenAI Responses-API tool wire format, plus the structured-output
|
|
3
|
+
// schema-name derivation (a stable, OpenAI-name-safe identifier for each
|
|
4
|
+
// response schema). These are pure helpers with no captured state.
|
|
5
|
+
import { typeboxToOpenAiSchema } from "./structured-output.js";
|
|
6
|
+
// -- tool translation --
|
|
7
|
+
export function translateTools(tools) {
|
|
8
|
+
return tools.map((tool) => {
|
|
9
|
+
switch (tool.kind) {
|
|
10
|
+
case "web_search":
|
|
11
|
+
return { type: "web_search" };
|
|
12
|
+
case "file_search":
|
|
13
|
+
return {
|
|
14
|
+
type: "file_search",
|
|
15
|
+
vector_store_ids: [tool.vectorStoreId],
|
|
16
|
+
};
|
|
17
|
+
case "mcp": {
|
|
18
|
+
const out = {
|
|
19
|
+
type: "mcp",
|
|
20
|
+
server_url: tool.serverUrl,
|
|
21
|
+
};
|
|
22
|
+
if (tool.toolName) {
|
|
23
|
+
return {
|
|
24
|
+
...out,
|
|
25
|
+
allowed_tools: [tool.toolName],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
30
|
+
case "function":
|
|
31
|
+
return {
|
|
32
|
+
type: "function",
|
|
33
|
+
name: tool.name,
|
|
34
|
+
description: tool.description,
|
|
35
|
+
parameters: typeboxToOpenAiSchema(tool.parameters),
|
|
36
|
+
strict: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export function findFunctionHandler(tools, name) {
|
|
42
|
+
if (!tools)
|
|
43
|
+
return undefined;
|
|
44
|
+
for (const tool of tools) {
|
|
45
|
+
if (tool.kind === "function" && tool.name === name) {
|
|
46
|
+
return tool;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
// -- schema name derivation --
|
|
52
|
+
export function deriveSchemaName(schema) {
|
|
53
|
+
const id = schema.$id;
|
|
54
|
+
if (typeof id === "string" && id.length > 0) {
|
|
55
|
+
return sanitizeName(id);
|
|
56
|
+
}
|
|
57
|
+
const serialized = canonicalJson(schema);
|
|
58
|
+
return `schema_${shortHash(serialized)}`;
|
|
59
|
+
}
|
|
60
|
+
function sanitizeName(raw) {
|
|
61
|
+
// OpenAI requires schema names match `^[a-zA-Z0-9_-]{1,64}$`.
|
|
62
|
+
const cleaned = raw.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64);
|
|
63
|
+
return cleaned.length > 0 ? cleaned : "schema";
|
|
64
|
+
}
|
|
65
|
+
function canonicalJson(value) {
|
|
66
|
+
return JSON.stringify(value, (_key, v) => {
|
|
67
|
+
if (v !== null && typeof v === "object" && !Array.isArray(v)) {
|
|
68
|
+
const obj = v;
|
|
69
|
+
const sorted = {};
|
|
70
|
+
for (const key of Object.keys(obj).sort()) {
|
|
71
|
+
sorted[key] = obj[key];
|
|
72
|
+
}
|
|
73
|
+
return sorted;
|
|
74
|
+
}
|
|
75
|
+
return v;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function shortHash(input) {
|
|
79
|
+
// Stable 12-hex-char hash. We avoid pulling `crypto.subtle` because
|
|
80
|
+
// it's async and would force `deriveSchemaName` to be async too;
|
|
81
|
+
// FNV-1a is sufficient for naming uniqueness within a process.
|
|
82
|
+
let h1 = 0xcbf29ce4;
|
|
83
|
+
let h2 = 0x84222325;
|
|
84
|
+
for (let i = 0; i < input.length; i += 1) {
|
|
85
|
+
const c = input.charCodeAt(i);
|
|
86
|
+
h1 = Math.imul(h1 ^ c, 0x01000193) >>> 0;
|
|
87
|
+
h2 = Math.imul(h2 ^ c, 0x01000193) >>> 0;
|
|
88
|
+
}
|
|
89
|
+
const hex1 = h1.toString(16).padStart(8, "0");
|
|
90
|
+
const hex2 = h2.toString(16).padStart(8, "0");
|
|
91
|
+
return (hex1 + hex2).slice(0, 12);
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=openai-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-tools.js","sourceRoot":"","sources":["../../../src/extensions/openai/openai-tools.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,wEAAwE;AACxE,yEAAyE;AACzE,mEAAmE;AAInE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAG9D,yBAAyB;AAEzB,MAAM,UAAU,cAAc,CAAC,KAA2B;IACtD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtB,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAChB,KAAK,YAAY;gBACb,OAAO,EAAE,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