@effect-uai/core 0.2.0 → 0.3.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/{AiError-CqmYjXyx.d.mts → AiError-CBuPHVKA.d.mts} +1 -1
- package/dist/{AiError-CqmYjXyx.d.mts.map → AiError-CBuPHVKA.d.mts.map} +1 -1
- package/dist/Image-BZmKfIdq.d.mts +61 -0
- package/dist/Image-BZmKfIdq.d.mts.map +1 -0
- package/dist/{Items-D1C2686t.d.mts → Items-CB8Bo3FI.d.mts} +132 -80
- package/dist/Items-CB8Bo3FI.d.mts.map +1 -0
- package/dist/Media-D_CpcM1Z.d.mts +57 -0
- package/dist/Media-D_CpcM1Z.d.mts.map +1 -0
- package/dist/{StructuredFormat-B5ueioNr.d.mts → StructuredFormat-BWq5Hd1O.d.mts} +5 -5
- package/dist/StructuredFormat-BWq5Hd1O.d.mts.map +1 -0
- package/dist/{Tool-5wxOCuOh.d.mts → Tool-DjVufH7i.d.mts} +13 -13
- package/dist/Tool-DjVufH7i.d.mts.map +1 -0
- package/dist/{Turn-Bi83du4I.d.mts → Turn-OPaILVIB.d.mts} +5 -11
- package/dist/Turn-OPaILVIB.d.mts.map +1 -0
- package/dist/{chunk-CfYAbeIz.mjs → chunk-uyGKjUfl.mjs} +2 -1
- package/dist/dist-DV5ISja1.mjs +13782 -0
- package/dist/dist-DV5ISja1.mjs.map +1 -0
- package/dist/domain/AiError.d.mts +1 -1
- package/dist/domain/AiError.mjs +1 -1
- package/dist/domain/Image.d.mts +2 -0
- package/dist/domain/Image.mjs +58 -0
- package/dist/domain/Image.mjs.map +1 -0
- package/dist/domain/Items.d.mts +2 -2
- package/dist/domain/Items.mjs +19 -42
- package/dist/domain/Items.mjs.map +1 -1
- package/dist/domain/Media.d.mts +2 -0
- package/dist/domain/Media.mjs +14 -0
- package/dist/domain/Media.mjs.map +1 -0
- package/dist/domain/Turn.d.mts +1 -1
- package/dist/domain/Turn.mjs +1 -1
- package/dist/embedding-model/Embedding.d.mts +107 -0
- package/dist/embedding-model/Embedding.d.mts.map +1 -0
- package/dist/embedding-model/Embedding.mjs +18 -0
- package/dist/embedding-model/Embedding.mjs.map +1 -0
- package/dist/embedding-model/EmbeddingModel.d.mts +97 -0
- package/dist/embedding-model/EmbeddingModel.d.mts.map +1 -0
- package/dist/embedding-model/EmbeddingModel.mjs +17 -0
- package/dist/embedding-model/EmbeddingModel.mjs.map +1 -0
- package/dist/index.d.mts +15 -7
- package/dist/index.mjs +10 -2
- package/dist/language-model/LanguageModel.d.mts +12 -20
- package/dist/language-model/LanguageModel.d.mts.map +1 -1
- package/dist/language-model/LanguageModel.mjs +3 -20
- package/dist/language-model/LanguageModel.mjs.map +1 -1
- package/dist/loop/Loop.d.mts +31 -7
- package/dist/loop/Loop.d.mts.map +1 -1
- package/dist/loop/Loop.mjs +39 -6
- package/dist/loop/Loop.mjs.map +1 -1
- package/dist/loop/Loop.test.d.mts +1 -0
- package/dist/loop/Loop.test.mjs +411 -0
- package/dist/loop/Loop.test.mjs.map +1 -0
- package/dist/magic-string.es-BgIV5Mu3.mjs +1013 -0
- package/dist/magic-string.es-BgIV5Mu3.mjs.map +1 -0
- package/dist/math/Vector.d.mts +47 -0
- package/dist/math/Vector.d.mts.map +1 -0
- package/dist/math/Vector.mjs +117 -0
- package/dist/math/Vector.mjs.map +1 -0
- package/dist/observability/Metrics.d.mts +2 -2
- package/dist/observability/Metrics.d.mts.map +1 -1
- package/dist/observability/Metrics.mjs +1 -1
- package/dist/observability/Metrics.mjs.map +1 -1
- package/dist/streaming/JSONL.mjs +1 -1
- package/dist/streaming/JSONL.test.d.mts +1 -0
- package/dist/streaming/JSONL.test.mjs +70 -0
- package/dist/streaming/JSONL.test.mjs.map +1 -0
- package/dist/streaming/Lines.mjs +1 -1
- package/dist/streaming/SSE.d.mts +2 -2
- package/dist/streaming/SSE.d.mts.map +1 -1
- package/dist/streaming/SSE.mjs +1 -1
- package/dist/streaming/SSE.mjs.map +1 -1
- package/dist/streaming/SSE.test.d.mts +1 -0
- package/dist/streaming/SSE.test.mjs +72 -0
- package/dist/streaming/SSE.test.mjs.map +1 -0
- package/dist/structured-format/StructuredFormat.d.mts +1 -1
- package/dist/structured-format/StructuredFormat.mjs +1 -1
- package/dist/structured-format/StructuredFormat.mjs.map +1 -1
- package/dist/testing/MockProvider.d.mts +6 -6
- package/dist/testing/MockProvider.d.mts.map +1 -1
- package/dist/testing/MockProvider.mjs.map +1 -1
- package/dist/tool/HistoryCheck.d.mts +6 -3
- package/dist/tool/HistoryCheck.d.mts.map +1 -1
- package/dist/tool/HistoryCheck.mjs +7 -1
- package/dist/tool/HistoryCheck.mjs.map +1 -1
- package/dist/tool/Outcome.d.mts +138 -2
- package/dist/tool/Outcome.d.mts.map +1 -0
- package/dist/tool/Outcome.mjs +32 -10
- package/dist/tool/Outcome.mjs.map +1 -1
- package/dist/tool/Resolvers.d.mts +11 -8
- package/dist/tool/Resolvers.d.mts.map +1 -1
- package/dist/tool/Resolvers.mjs +10 -1
- package/dist/tool/Resolvers.mjs.map +1 -1
- package/dist/tool/Resolvers.test.d.mts +1 -0
- package/dist/tool/Resolvers.test.mjs +317 -0
- package/dist/tool/Resolvers.test.mjs.map +1 -0
- package/dist/tool/Tool.d.mts +1 -1
- package/dist/tool/Tool.mjs +1 -1
- package/dist/tool/Tool.mjs.map +1 -1
- package/dist/tool/ToolEvent.d.mts +151 -2
- package/dist/tool/ToolEvent.d.mts.map +1 -0
- package/dist/tool/ToolEvent.mjs +30 -4
- package/dist/tool/ToolEvent.mjs.map +1 -1
- package/dist/tool/Toolkit.d.mts +19 -10
- package/dist/tool/Toolkit.d.mts.map +1 -1
- package/dist/tool/Toolkit.mjs +5 -5
- package/dist/tool/Toolkit.mjs.map +1 -1
- package/dist/tool/Toolkit.test.d.mts +1 -0
- package/dist/tool/Toolkit.test.mjs +113 -0
- package/dist/tool/Toolkit.test.mjs.map +1 -0
- package/package.json +29 -13
- package/src/domain/Image.ts +75 -0
- package/src/domain/Items.ts +18 -47
- package/src/domain/Media.ts +61 -0
- package/src/embedding-model/Embedding.ts +117 -0
- package/src/embedding-model/EmbeddingModel.ts +107 -0
- package/src/index.ts +9 -1
- package/src/language-model/LanguageModel.ts +2 -22
- package/src/loop/Loop.test.ts +114 -2
- package/src/loop/Loop.ts +69 -5
- package/src/math/Vector.ts +138 -0
- package/src/observability/Metrics.ts +1 -1
- package/src/streaming/SSE.ts +1 -1
- package/src/structured-format/StructuredFormat.ts +2 -2
- package/src/testing/MockProvider.ts +2 -2
- package/src/tool/HistoryCheck.ts +2 -5
- package/src/tool/Outcome.ts +36 -36
- package/src/tool/Resolvers.test.ts +11 -35
- package/src/tool/Resolvers.ts +5 -14
- package/src/tool/Tool.ts +9 -9
- package/src/tool/ToolEvent.ts +28 -24
- package/src/tool/Toolkit.test.ts +97 -2
- package/src/tool/Toolkit.ts +57 -33
- package/dist/Items-D1C2686t.d.mts.map +0 -1
- package/dist/Outcome-GiaNvt7i.d.mts +0 -32
- package/dist/Outcome-GiaNvt7i.d.mts.map +0 -1
- package/dist/StructuredFormat-B5ueioNr.d.mts.map +0 -1
- package/dist/Tool-5wxOCuOh.d.mts.map +0 -1
- package/dist/ToolEvent-wTMgb2GO.d.mts +0 -29
- package/dist/ToolEvent-wTMgb2GO.d.mts.map +0 -1
- package/dist/Turn-Bi83du4I.d.mts.map +0 -1
- package/dist/match/Match.d.mts +0 -16
- package/dist/match/Match.d.mts.map +0 -1
- package/dist/match/Match.mjs +0 -15
- package/dist/match/Match.mjs.map +0 -1
- package/src/match/Match.ts +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Cancelled, c as GenerationFailed, d as RateLimited, f as Scope, i as AuthSubtype, l as IncompleteTurn, m as Unavailable, o as ContentFiltered, p as Timeout, r as AuthFailed, s as ContextLengthExceeded, t as AiError, u as InvalidRequest } from "../AiError-
|
|
1
|
+
import { a as Cancelled, c as GenerationFailed, d as RateLimited, f as Scope, i as AuthSubtype, l as IncompleteTurn, m as Unavailable, o as ContentFiltered, p as Timeout, r as AuthFailed, s as ContextLengthExceeded, t as AiError, u as InvalidRequest } from "../AiError-CBuPHVKA.mjs";
|
|
2
2
|
export { AiError, AuthFailed, AuthSubtype, Cancelled, ContentFiltered, ContextLengthExceeded, GenerationFailed, IncompleteTurn, InvalidRequest, RateLimited, Scope, Timeout, Unavailable };
|
package/dist/domain/AiError.mjs
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ImageUrlSource, c as imageBytes, d as isImageBytes, f as isImageUrl, i as ImageSource, l as imageUrl, n as ImageBytesSource, r as ImageMimeType, s as imageBase64, t as ImageBase64Source, u as isImageBase64 } from "../Image-BZmKfIdq.mjs";
|
|
2
|
+
export { ImageBase64Source, ImageBytesSource, ImageMimeType, ImageSource, ImageUrlSource, imageBase64, imageBytes, imageUrl, isImageBase64, isImageBytes, isImageUrl };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { n as __exportAll } from "../chunk-uyGKjUfl.mjs";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
//#region src/domain/Image.ts
|
|
4
|
+
var Image_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
ImageBase64Source: () => ImageBase64Source,
|
|
6
|
+
ImageBytesSource: () => ImageBytesSource,
|
|
7
|
+
ImageSource: () => ImageSource,
|
|
8
|
+
ImageUrlSource: () => ImageUrlSource,
|
|
9
|
+
imageBase64: () => imageBase64,
|
|
10
|
+
imageBytes: () => imageBytes,
|
|
11
|
+
imageUrl: () => imageUrl,
|
|
12
|
+
isImageBase64: () => isImageBase64,
|
|
13
|
+
isImageBytes: () => isImageBytes,
|
|
14
|
+
isImageUrl: () => isImageUrl
|
|
15
|
+
});
|
|
16
|
+
const ImageMimeTypeSchema = Schema.String;
|
|
17
|
+
const ImageUrlSource = Schema.TaggedStruct("url", {
|
|
18
|
+
url: Schema.String,
|
|
19
|
+
mimeType: Schema.optional(ImageMimeTypeSchema)
|
|
20
|
+
});
|
|
21
|
+
const ImageBase64Source = Schema.TaggedStruct("base64", {
|
|
22
|
+
base64: Schema.String,
|
|
23
|
+
mimeType: ImageMimeTypeSchema
|
|
24
|
+
});
|
|
25
|
+
const ImageBytesSource = Schema.TaggedStruct("bytes", {
|
|
26
|
+
bytes: Schema.Uint8Array,
|
|
27
|
+
mimeType: ImageMimeTypeSchema
|
|
28
|
+
});
|
|
29
|
+
const ImageSource = Schema.Union([
|
|
30
|
+
ImageUrlSource,
|
|
31
|
+
ImageBase64Source,
|
|
32
|
+
ImageBytesSource
|
|
33
|
+
]);
|
|
34
|
+
const imageUrl = (url, mimeType) => mimeType !== void 0 ? {
|
|
35
|
+
_tag: "url",
|
|
36
|
+
url,
|
|
37
|
+
mimeType
|
|
38
|
+
} : {
|
|
39
|
+
_tag: "url",
|
|
40
|
+
url
|
|
41
|
+
};
|
|
42
|
+
const imageBase64 = (base64, mimeType) => ({
|
|
43
|
+
_tag: "base64",
|
|
44
|
+
base64,
|
|
45
|
+
mimeType
|
|
46
|
+
});
|
|
47
|
+
const imageBytes = (bytes, mimeType) => ({
|
|
48
|
+
_tag: "bytes",
|
|
49
|
+
bytes,
|
|
50
|
+
mimeType
|
|
51
|
+
});
|
|
52
|
+
const isImageUrl = Schema.is(ImageUrlSource);
|
|
53
|
+
const isImageBase64 = Schema.is(ImageBase64Source);
|
|
54
|
+
const isImageBytes = Schema.is(ImageBytesSource);
|
|
55
|
+
//#endregion
|
|
56
|
+
export { ImageBase64Source, ImageBytesSource, ImageSource, ImageUrlSource, imageBase64, imageBytes, imageUrl, isImageBase64, isImageBytes, isImageUrl, Image_exports as t };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=Image.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.mjs","names":[],"sources":["../../src/domain/Image.ts"],"sourcesContent":["import { Schema } from \"effect\"\nimport type { MediaBase64, MediaBytes, MediaSource, MediaUrl } from \"./Media.js\"\n\n/**\n * Image MIME types AI providers typically accept. The first four are the\n * universal subset (Cohere v4, Voyage multimodal, Jina v4, Google\n * `gemini-embedding-2`); HEIC / HEIF are Google-specific. The\n * `(string & {})` tail keeps autocomplete on the literals while still\n * accepting any string, so a newly-supported format works without an\n * SDK update.\n */\nexport type ImageMimeType =\n | \"image/png\"\n | \"image/jpeg\"\n | \"image/webp\"\n | \"image/gif\"\n | \"image/heic\"\n | \"image/heif\"\n // eslint-disable-next-line @typescript-eslint/ban-types\n | (string & {})\n\nconst ImageMimeTypeSchema = Schema.String as unknown as Schema.Schema<ImageMimeType>\n\nexport type ImageUrlSource = MediaUrl<ImageMimeType>\nexport type ImageBase64Source = MediaBase64<ImageMimeType>\nexport type ImageBytesSource = MediaBytes<ImageMimeType>\n\n/**\n * Where an image lives. Provider layers normalize across these:\n * `bytes` becomes a base64 data URI for OpenAI / Anthropic, an\n * `inlineData` part for Gemini, and a separate field for Cohere /\n * Voyage. URL constraints (must be HTTPS, must be public, …) are\n * provider-specific and validated at the layer, not in the type.\n */\nexport type ImageSource = MediaSource<ImageMimeType>\n\nexport const ImageUrlSource = Schema.TaggedStruct(\"url\", {\n url: Schema.String,\n mimeType: Schema.optional(ImageMimeTypeSchema),\n})\n\nexport const ImageBase64Source = Schema.TaggedStruct(\"base64\", {\n base64: Schema.String,\n mimeType: ImageMimeTypeSchema,\n})\n\nexport const ImageBytesSource = Schema.TaggedStruct(\"bytes\", {\n bytes: Schema.Uint8Array,\n mimeType: ImageMimeTypeSchema,\n})\n\nexport const ImageSource: Schema.Schema<ImageSource> = Schema.Union([\n ImageUrlSource,\n ImageBase64Source,\n ImageBytesSource,\n]) as unknown as Schema.Schema<ImageSource>\n\nexport const imageUrl = (url: string, mimeType?: ImageMimeType): ImageUrlSource =>\n mimeType !== undefined ? { _tag: \"url\", url, mimeType } : { _tag: \"url\", url }\n\nexport const imageBase64 = (base64: string, mimeType: ImageMimeType): ImageBase64Source => ({\n _tag: \"base64\",\n base64,\n mimeType,\n})\n\nexport const imageBytes = (bytes: Uint8Array, mimeType: ImageMimeType): ImageBytesSource => ({\n _tag: \"bytes\",\n bytes,\n mimeType,\n})\n\nexport const isImageUrl = Schema.is(ImageUrlSource)\nexport const isImageBase64 = Schema.is(ImageBase64Source)\nexport const isImageBytes = Schema.is(ImageBytesSource)\n"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAM,sBAAsB,OAAO;AAenC,MAAa,iBAAiB,OAAO,aAAa,OAAO;CACvD,KAAK,OAAO;CACZ,UAAU,OAAO,SAAS,oBAAoB;CAC/C,CAAC;AAEF,MAAa,oBAAoB,OAAO,aAAa,UAAU;CAC7D,QAAQ,OAAO;CACf,UAAU;CACX,CAAC;AAEF,MAAa,mBAAmB,OAAO,aAAa,SAAS;CAC3D,OAAO,OAAO;CACd,UAAU;CACX,CAAC;AAEF,MAAa,cAA0C,OAAO,MAAM;CAClE;CACA;CACA;CACD,CAAC;AAEF,MAAa,YAAY,KAAa,aACpC,aAAa,KAAA,IAAY;CAAE,MAAM;CAAO;CAAK;CAAU,GAAG;CAAE,MAAM;CAAO;CAAK;AAEhF,MAAa,eAAe,QAAgB,cAAgD;CAC1F,MAAM;CACN;CACA;CACD;AAED,MAAa,cAAc,OAAmB,cAA+C;CAC3F,MAAM;CACN;CACA;CACD;AAED,MAAa,aAAa,OAAO,GAAG,eAAe;AACnD,MAAa,gBAAgB,OAAO,GAAG,kBAAkB;AACzD,MAAa,eAAe,OAAO,GAAG,iBAAiB"}
|
package/dist/domain/Items.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { Annotation, ContainerFileCitation, ContentBlock, FileCitation, FilePath, FunctionCall, FunctionCallOutput,
|
|
1
|
+
import { A as isInputText, C as functionCallOutput, D as isFunctionCall, E as isFilePath, F as isUrlCitation, I as systemText, L as userText, M as isOutputText, N as isReasoning, O as isFunctionCallOutput, P as isRefusal, S as assistantText, T as isFileCitation, _ as Refusal, a as FilePath, b as UrlCitation, c as InputImage, d as Item, g as Reasoning, h as OutputTokensDetails, i as FileCitation, j as isMessage, k as isInputImage, l as InputText, m as OutputText, n as ContainerFileCitation, o as FunctionCall, p as Message, r as ContentBlock, s as FunctionCallOutput, t as Annotation, u as InputTokensDetails, v as Role, w as isContainerFileCitation, x as Usage, y as StopReason } from "../Items-CB8Bo3FI.mjs";
|
|
2
|
+
export { Annotation, ContainerFileCitation, ContentBlock, FileCitation, FilePath, FunctionCall, FunctionCallOutput, InputImage, InputText, InputTokensDetails, Item, Message, OutputText, OutputTokensDetails, Reasoning, Refusal, Role, StopReason, UrlCitation, Usage, assistantText, functionCallOutput, isContainerFileCitation, isFileCitation, isFilePath, isFunctionCall, isFunctionCallOutput, isInputImage, isInputText, isMessage, isOutputText, isReasoning, isRefusal, isUrlCitation, systemText, userText };
|
package/dist/domain/Items.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __exportAll } from "../chunk-uyGKjUfl.mjs";
|
|
2
|
+
import { ImageSource } from "./Image.mjs";
|
|
2
3
|
import { Schema } from "effect";
|
|
3
4
|
//#region src/domain/Items.ts
|
|
4
5
|
var Items_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -9,9 +10,6 @@ var Items_exports = /* @__PURE__ */ __exportAll({
|
|
|
9
10
|
FilePath: () => FilePath,
|
|
10
11
|
FunctionCall: () => FunctionCall,
|
|
11
12
|
FunctionCallOutput: () => FunctionCallOutput,
|
|
12
|
-
ImageBase64Source: () => ImageBase64Source,
|
|
13
|
-
ImageSource: () => ImageSource,
|
|
14
|
-
ImageUrlSource: () => ImageUrlSource,
|
|
15
13
|
InputImage: () => InputImage,
|
|
16
14
|
InputText: () => InputText,
|
|
17
15
|
InputTokensDetails: () => InputTokensDetails,
|
|
@@ -32,8 +30,6 @@ var Items_exports = /* @__PURE__ */ __exportAll({
|
|
|
32
30
|
isFilePath: () => isFilePath,
|
|
33
31
|
isFunctionCall: () => isFunctionCall,
|
|
34
32
|
isFunctionCallOutput: () => isFunctionCallOutput,
|
|
35
|
-
isImageBase64Source: () => isImageBase64Source,
|
|
36
|
-
isImageUrlSource: () => isImageUrlSource,
|
|
37
33
|
isInputImage: () => isInputImage,
|
|
38
34
|
isInputText: () => isInputText,
|
|
39
35
|
isMessage: () => isMessage,
|
|
@@ -49,31 +45,12 @@ const InputText = Schema.Struct({
|
|
|
49
45
|
text: Schema.String
|
|
50
46
|
});
|
|
51
47
|
/**
|
|
52
|
-
* Where an image lives. `url` covers HTTP(S) URLs (the model fetches
|
|
53
|
-
* them); `base64` covers inline bytes embedded in the request. Provider
|
|
54
|
-
* encoders dispatch on `_tag`. File-id / uploaded-asset references are
|
|
55
|
-
* provider-specific and stay out of this union for now.
|
|
56
|
-
*/
|
|
57
|
-
const ImageUrlSource = Schema.Struct({
|
|
58
|
-
_tag: Schema.Literal("url"),
|
|
59
|
-
url: Schema.String
|
|
60
|
-
});
|
|
61
|
-
/**
|
|
62
|
-
* Inline image bytes. `data` is **already base64-encoded** (matches what
|
|
63
|
-
* the wire formats expect; no double-encoding needed downstream).
|
|
64
|
-
* `media_type` is the MIME type, e.g. `"image/png"`.
|
|
65
|
-
*/
|
|
66
|
-
const ImageBase64Source = Schema.Struct({
|
|
67
|
-
_tag: Schema.Literal("base64"),
|
|
68
|
-
media_type: Schema.String,
|
|
69
|
-
data: Schema.String
|
|
70
|
-
});
|
|
71
|
-
const ImageSource = Schema.Union([ImageUrlSource, ImageBase64Source]);
|
|
72
|
-
const isImageUrlSource = (s) => s._tag === "url";
|
|
73
|
-
const isImageBase64Source = (s) => s._tag === "base64";
|
|
74
|
-
/**
|
|
75
48
|
* User-provided image content block. Pair with `InputText` inside a
|
|
76
49
|
* `Message.content` array to ask "what's in this image?" style questions.
|
|
50
|
+
*
|
|
51
|
+
* `source` is the cross-modality `ImageSource` from `domain/Image.ts` -
|
|
52
|
+
* url, base64, or raw bytes. Provider codecs encode bytes to whatever
|
|
53
|
+
* wire format the provider wants.
|
|
77
54
|
*/
|
|
78
55
|
const InputImage = Schema.Struct({
|
|
79
56
|
type: Schema.Literal("input_image"),
|
|
@@ -109,10 +86,10 @@ const Annotation = Schema.Union([
|
|
|
109
86
|
ContainerFileCitation,
|
|
110
87
|
FilePath
|
|
111
88
|
]);
|
|
112
|
-
const isUrlCitation = (
|
|
113
|
-
const isFileCitation = (
|
|
114
|
-
const isContainerFileCitation = (
|
|
115
|
-
const isFilePath = (
|
|
89
|
+
const isUrlCitation = Schema.is(UrlCitation);
|
|
90
|
+
const isFileCitation = Schema.is(FileCitation);
|
|
91
|
+
const isContainerFileCitation = Schema.is(ContainerFileCitation);
|
|
92
|
+
const isFilePath = Schema.is(FilePath);
|
|
116
93
|
const OutputText = Schema.Struct({
|
|
117
94
|
type: Schema.Literal("output_text"),
|
|
118
95
|
text: Schema.String,
|
|
@@ -178,14 +155,14 @@ const Item = Schema.Union([
|
|
|
178
155
|
FunctionCallOutput,
|
|
179
156
|
Reasoning
|
|
180
157
|
]);
|
|
181
|
-
const isInputText = (
|
|
182
|
-
const isInputImage = (
|
|
183
|
-
const isOutputText = (
|
|
184
|
-
const isRefusal = (
|
|
185
|
-
const isMessage = (
|
|
186
|
-
const isFunctionCall = (
|
|
187
|
-
const isFunctionCallOutput = (
|
|
188
|
-
const isReasoning = (
|
|
158
|
+
const isInputText = Schema.is(InputText);
|
|
159
|
+
const isInputImage = Schema.is(InputImage);
|
|
160
|
+
const isOutputText = Schema.is(OutputText);
|
|
161
|
+
const isRefusal = Schema.is(Refusal);
|
|
162
|
+
const isMessage = Schema.is(Message);
|
|
163
|
+
const isFunctionCall = Schema.is(FunctionCall);
|
|
164
|
+
const isFunctionCallOutput = Schema.is(FunctionCallOutput);
|
|
165
|
+
const isReasoning = Schema.is(Reasoning);
|
|
189
166
|
const InputTokensDetails = Schema.Struct({ cached_tokens: Schema.optional(Schema.Number) });
|
|
190
167
|
const OutputTokensDetails = Schema.Struct({ reasoning_tokens: Schema.optional(Schema.Number) });
|
|
191
168
|
const Usage = Schema.Struct({
|
|
@@ -233,6 +210,6 @@ const functionCallOutput = (call_id, output) => ({
|
|
|
233
210
|
output
|
|
234
211
|
});
|
|
235
212
|
//#endregion
|
|
236
|
-
export { Annotation, ContainerFileCitation, ContentBlock, FileCitation, FilePath, FunctionCall, FunctionCallOutput,
|
|
213
|
+
export { Annotation, ContainerFileCitation, ContentBlock, FileCitation, FilePath, FunctionCall, FunctionCallOutput, InputImage, InputText, InputTokensDetails, Item, Message, OutputText, OutputTokensDetails, Reasoning, Refusal, Role, StopReason, UrlCitation, Usage, assistantText, functionCallOutput, isContainerFileCitation, isFileCitation, isFilePath, isFunctionCall, isFunctionCallOutput, isInputImage, isInputText, isMessage, isOutputText, isReasoning, isRefusal, isUrlCitation, systemText, Items_exports as t, userText };
|
|
237
214
|
|
|
238
215
|
//# sourceMappingURL=Items.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Items.mjs","names":[],"sources":["../../src/domain/Items.ts"],"sourcesContent":["import { Schema } from \"effect\"\n\n// ---------------------------------------------------------------------------\n// Content blocks (inside Message.content)\n// ---------------------------------------------------------------------------\n\nexport const InputText = Schema.Struct({\n type: Schema.Literal(\"input_text\"),\n text: Schema.String,\n})\nexport type InputText = typeof InputText.Type\n\n/**\n * Where an image lives. `url` covers HTTP(S) URLs (the model fetches\n * them); `base64` covers inline bytes embedded in the request. Provider\n * encoders dispatch on `_tag`. File-id / uploaded-asset references are\n * provider-specific and stay out of this union for now.\n */\nexport const ImageUrlSource = Schema.Struct({\n _tag: Schema.Literal(\"url\"),\n url: Schema.String,\n})\nexport type ImageUrlSource = typeof ImageUrlSource.Type\n\n/**\n * Inline image bytes. `data` is **already base64-encoded** (matches what\n * the wire formats expect; no double-encoding needed downstream).\n * `media_type` is the MIME type, e.g. `\"image/png\"`.\n */\nexport const ImageBase64Source = Schema.Struct({\n _tag: Schema.Literal(\"base64\"),\n media_type: Schema.String,\n data: Schema.String,\n})\nexport type ImageBase64Source = typeof ImageBase64Source.Type\n\nexport const ImageSource = Schema.Union([ImageUrlSource, ImageBase64Source])\nexport type ImageSource = typeof ImageSource.Type\n\nexport const isImageUrlSource = (s: ImageSource): s is ImageUrlSource => s._tag === \"url\"\nexport const isImageBase64Source = (s: ImageSource): s is ImageBase64Source => s._tag === \"base64\"\n\n/**\n * User-provided image content block. Pair with `InputText` inside a\n * `Message.content` array to ask \"what's in this image?\" style questions.\n */\nexport const InputImage = Schema.Struct({\n type: Schema.Literal(\"input_image\"),\n source: ImageSource,\n})\nexport type InputImage = typeof InputImage.Type\n\n// ---------------------------------------------------------------------------\n// Annotations - source / citation pointers attached to `output_text` blocks.\n// Mirrors OpenAI Responses API; other providers can omit or map onto these\n// shapes.\n// ---------------------------------------------------------------------------\n\nexport const UrlCitation = Schema.Struct({\n type: Schema.Literal(\"url_citation\"),\n url: Schema.String,\n start_index: Schema.Number,\n end_index: Schema.Number,\n title: Schema.String,\n})\nexport type UrlCitation = typeof UrlCitation.Type\n\nexport const FileCitation = Schema.Struct({\n type: Schema.Literal(\"file_citation\"),\n file_id: Schema.String,\n index: Schema.Number,\n})\nexport type FileCitation = typeof FileCitation.Type\n\nexport const ContainerFileCitation = Schema.Struct({\n type: Schema.Literal(\"container_file_citation\"),\n container_id: Schema.String,\n file_id: Schema.String,\n start_index: Schema.Number,\n end_index: Schema.Number,\n})\nexport type ContainerFileCitation = typeof ContainerFileCitation.Type\n\nexport const FilePath = Schema.Struct({\n type: Schema.Literal(\"file_path\"),\n file_id: Schema.String,\n index: Schema.Number,\n})\nexport type FilePath = typeof FilePath.Type\n\nexport const Annotation = Schema.Union([UrlCitation, FileCitation, ContainerFileCitation, FilePath])\nexport type Annotation = typeof Annotation.Type\n\nexport const isUrlCitation = (a: Annotation): a is UrlCitation => a.type === \"url_citation\"\nexport const isFileCitation = (a: Annotation): a is FileCitation => a.type === \"file_citation\"\nexport const isContainerFileCitation = (a: Annotation): a is ContainerFileCitation =>\n a.type === \"container_file_citation\"\nexport const isFilePath = (a: Annotation): a is FilePath => a.type === \"file_path\"\n\nexport const OutputText = Schema.Struct({\n type: Schema.Literal(\"output_text\"),\n text: Schema.String,\n annotations: Schema.optional(Schema.Array(Annotation)),\n})\nexport type OutputText = typeof OutputText.Type\n\n/**\n * Model-emitted refusal. Distinct from `output_text`: the model declined\n * to answer rather than producing normal output. Pair with\n * `stop_reason: \"refusal\"` on the surrounding `Turn`. Streamed via the\n * `refusal_delta` `TurnEvent`.\n */\nexport const Refusal = Schema.Struct({\n type: Schema.Literal(\"refusal\"),\n text: Schema.String,\n})\nexport type Refusal = typeof Refusal.Type\n\nexport const ContentBlock = Schema.Union([InputText, InputImage, OutputText, Refusal])\nexport type ContentBlock = typeof ContentBlock.Type\n\nexport const Role = Schema.Literals([\"user\", \"assistant\", \"system\"])\nexport type Role = typeof Role.Type\n\n// ---------------------------------------------------------------------------\n// Provider passthrough - every Item type carries this opaque slot.\n// The framework never reads or interprets it; provider modules decode\n// their own data via their own typed readers (see e.g.\n// the `@effect-uai/responses` package).\n// ---------------------------------------------------------------------------\n\nconst ProviderData = Schema.optional(Schema.Unknown)\n\n// ---------------------------------------------------------------------------\n// Items\n// ---------------------------------------------------------------------------\n\nexport const Message = Schema.Struct({\n type: Schema.Literal(\"message\"),\n role: Role,\n content: Schema.Array(ContentBlock),\n providerData: ProviderData,\n})\nexport type Message = typeof Message.Type\n\nexport const FunctionCall = Schema.Struct({\n type: Schema.Literal(\"function_call\"),\n call_id: Schema.String,\n name: Schema.String,\n // JSON-encoded arguments string, mirroring OpenAI Responses API\n arguments: Schema.String,\n providerData: ProviderData,\n})\nexport type FunctionCall = typeof FunctionCall.Type\n\nexport const FunctionCallOutput = Schema.Struct({\n type: Schema.Literal(\"function_call_output\"),\n call_id: Schema.String,\n output: Schema.String,\n providerData: ProviderData,\n})\nexport type FunctionCallOutput = typeof FunctionCallOutput.Type\n\n/**\n * Reasoning item - top-level, mirrors OpenAI Responses API. Common shape\n * across providers covers `summary` (human-readable text) and `signature`\n * (opaque round-trip blob - Anthropic's signed thinking, OpenAI's\n * encrypted_content, etc.). Provider-specific fields go in `providerData`.\n */\nexport const Reasoning = Schema.Struct({\n type: Schema.Literal(\"reasoning\"),\n id: Schema.optional(Schema.String),\n summary: Schema.optional(Schema.String),\n signature: Schema.optional(Schema.String),\n providerData: ProviderData,\n})\nexport type Reasoning = typeof Reasoning.Type\n\nexport const Item = Schema.Union([Message, FunctionCall, FunctionCallOutput, Reasoning])\nexport type Item = typeof Item.Type\n\n// ---------------------------------------------------------------------------\n// Type guards\n// ---------------------------------------------------------------------------\n\nexport const isInputText = (block: ContentBlock): block is InputText => block.type === \"input_text\"\nexport const isInputImage = (block: ContentBlock): block is InputImage =>\n block.type === \"input_image\"\nexport const isOutputText = (block: ContentBlock): block is OutputText =>\n block.type === \"output_text\"\nexport const isRefusal = (block: ContentBlock): block is Refusal => block.type === \"refusal\"\n\nexport const isMessage = (item: Item): item is Message => item.type === \"message\"\nexport const isFunctionCall = (item: Item): item is FunctionCall => item.type === \"function_call\"\nexport const isFunctionCallOutput = (item: Item): item is FunctionCallOutput =>\n item.type === \"function_call_output\"\nexport const isReasoning = (item: Item): item is Reasoning => item.type === \"reasoning\"\n\n// ---------------------------------------------------------------------------\n// Usage and stop reason\n// ---------------------------------------------------------------------------\n\nexport const InputTokensDetails = Schema.Struct({\n cached_tokens: Schema.optional(Schema.Number),\n})\nexport type InputTokensDetails = typeof InputTokensDetails.Type\n\nexport const OutputTokensDetails = Schema.Struct({\n reasoning_tokens: Schema.optional(Schema.Number),\n})\nexport type OutputTokensDetails = typeof OutputTokensDetails.Type\n\nexport const Usage = Schema.Struct({\n input_tokens: Schema.optional(Schema.Number),\n output_tokens: Schema.optional(Schema.Number),\n total_tokens: Schema.optional(Schema.Number),\n input_tokens_details: Schema.optional(InputTokensDetails),\n output_tokens_details: Schema.optional(OutputTokensDetails),\n})\nexport type Usage = typeof Usage.Type\n\nexport const StopReason = Schema.Literals([\n \"stop\",\n \"tool_calls\",\n \"max_tokens\",\n \"refusal\",\n /** Provider-side safety classifier flagged the output. */\n \"content_filter\",\n /** Server-enforced cap on tool calls per turn was hit. */\n \"max_tool_calls\",\n])\nexport type StopReason = typeof StopReason.Type\n\n// ---------------------------------------------------------------------------\n// Helper constructors\n// ---------------------------------------------------------------------------\n\nexport const userText = (text: string): Message => ({\n type: \"message\",\n role: \"user\",\n content: [{ type: \"input_text\", text }],\n})\n\nexport const systemText = (text: string): Message => ({\n type: \"message\",\n role: \"system\",\n content: [{ type: \"input_text\", text }],\n})\n\nexport const assistantText = (text: string): Message => ({\n type: \"message\",\n role: \"assistant\",\n content: [{ type: \"output_text\", text }],\n})\n\nexport const functionCallOutput = (call_id: string, output: string): FunctionCallOutput => ({\n type: \"function_call_output\",\n call_id,\n output,\n})\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Items.mjs","names":[],"sources":["../../src/domain/Items.ts"],"sourcesContent":["import { Schema } from \"effect\"\nimport { ImageSource } from \"./Image.js\"\n\n// ---------------------------------------------------------------------------\n// Content blocks (inside Message.content)\n// ---------------------------------------------------------------------------\n\nexport const InputText = Schema.Struct({\n type: Schema.Literal(\"input_text\"),\n text: Schema.String,\n})\nexport type InputText = typeof InputText.Type\n\n/**\n * User-provided image content block. Pair with `InputText` inside a\n * `Message.content` array to ask \"what's in this image?\" style questions.\n *\n * `source` is the cross-modality `ImageSource` from `domain/Image.ts` -\n * url, base64, or raw bytes. Provider codecs encode bytes to whatever\n * wire format the provider wants.\n */\nexport const InputImage = Schema.Struct({\n type: Schema.Literal(\"input_image\"),\n source: ImageSource,\n})\nexport type InputImage = typeof InputImage.Type\n\n// ---------------------------------------------------------------------------\n// Annotations - source / citation pointers attached to `output_text` blocks.\n// Mirrors OpenAI Responses API; other providers can omit or map onto these\n// shapes.\n// ---------------------------------------------------------------------------\n\nexport const UrlCitation = Schema.Struct({\n type: Schema.Literal(\"url_citation\"),\n url: Schema.String,\n start_index: Schema.Number,\n end_index: Schema.Number,\n title: Schema.String,\n})\nexport type UrlCitation = typeof UrlCitation.Type\n\nexport const FileCitation = Schema.Struct({\n type: Schema.Literal(\"file_citation\"),\n file_id: Schema.String,\n index: Schema.Number,\n})\nexport type FileCitation = typeof FileCitation.Type\n\nexport const ContainerFileCitation = Schema.Struct({\n type: Schema.Literal(\"container_file_citation\"),\n container_id: Schema.String,\n file_id: Schema.String,\n start_index: Schema.Number,\n end_index: Schema.Number,\n})\nexport type ContainerFileCitation = typeof ContainerFileCitation.Type\n\nexport const FilePath = Schema.Struct({\n type: Schema.Literal(\"file_path\"),\n file_id: Schema.String,\n index: Schema.Number,\n})\nexport type FilePath = typeof FilePath.Type\n\nexport const Annotation = Schema.Union([UrlCitation, FileCitation, ContainerFileCitation, FilePath])\nexport type Annotation = typeof Annotation.Type\n\nexport const isUrlCitation = Schema.is(UrlCitation)\nexport const isFileCitation = Schema.is(FileCitation)\nexport const isContainerFileCitation = Schema.is(ContainerFileCitation)\nexport const isFilePath = Schema.is(FilePath)\n\nexport const OutputText = Schema.Struct({\n type: Schema.Literal(\"output_text\"),\n text: Schema.String,\n annotations: Schema.optional(Schema.Array(Annotation)),\n})\nexport type OutputText = typeof OutputText.Type\n\n/**\n * Model-emitted refusal. Distinct from `output_text`: the model declined\n * to answer rather than producing normal output. Pair with\n * `stop_reason: \"refusal\"` on the surrounding `Turn`. Streamed via the\n * `refusal_delta` `TurnEvent`.\n */\nexport const Refusal = Schema.Struct({\n type: Schema.Literal(\"refusal\"),\n text: Schema.String,\n})\nexport type Refusal = typeof Refusal.Type\n\nexport const ContentBlock = Schema.Union([InputText, InputImage, OutputText, Refusal])\nexport type ContentBlock = typeof ContentBlock.Type\n\nexport const Role = Schema.Literals([\"user\", \"assistant\", \"system\"])\nexport type Role = typeof Role.Type\n\n// ---------------------------------------------------------------------------\n// Provider passthrough - every Item type carries this opaque slot.\n// The framework never reads or interprets it; provider modules decode\n// their own data via their own typed readers (see e.g.\n// the `@effect-uai/responses` package).\n// ---------------------------------------------------------------------------\n\nconst ProviderData = Schema.optional(Schema.Unknown)\n\n// ---------------------------------------------------------------------------\n// Items\n// ---------------------------------------------------------------------------\n\nexport const Message = Schema.Struct({\n type: Schema.Literal(\"message\"),\n role: Role,\n content: Schema.Array(ContentBlock),\n providerData: ProviderData,\n})\nexport type Message = typeof Message.Type\n\nexport const FunctionCall = Schema.Struct({\n type: Schema.Literal(\"function_call\"),\n call_id: Schema.String,\n name: Schema.String,\n // JSON-encoded arguments string, mirroring OpenAI Responses API\n arguments: Schema.String,\n providerData: ProviderData,\n})\nexport type FunctionCall = typeof FunctionCall.Type\n\nexport const FunctionCallOutput = Schema.Struct({\n type: Schema.Literal(\"function_call_output\"),\n call_id: Schema.String,\n output: Schema.String,\n providerData: ProviderData,\n})\nexport type FunctionCallOutput = typeof FunctionCallOutput.Type\n\n/**\n * Reasoning item - top-level, mirrors OpenAI Responses API. Common shape\n * across providers covers `summary` (human-readable text) and `signature`\n * (opaque round-trip blob - Anthropic's signed thinking, OpenAI's\n * encrypted_content, etc.). Provider-specific fields go in `providerData`.\n */\nexport const Reasoning = Schema.Struct({\n type: Schema.Literal(\"reasoning\"),\n id: Schema.optional(Schema.String),\n summary: Schema.optional(Schema.String),\n signature: Schema.optional(Schema.String),\n providerData: ProviderData,\n})\nexport type Reasoning = typeof Reasoning.Type\n\nexport const Item = Schema.Union([Message, FunctionCall, FunctionCallOutput, Reasoning])\nexport type Item = typeof Item.Type\n\n// ---------------------------------------------------------------------------\n// Type guards\n// ---------------------------------------------------------------------------\n\nexport const isInputText = Schema.is(InputText)\nexport const isInputImage = Schema.is(InputImage)\nexport const isOutputText = Schema.is(OutputText)\nexport const isRefusal = Schema.is(Refusal)\n\nexport const isMessage = Schema.is(Message)\nexport const isFunctionCall = Schema.is(FunctionCall)\nexport const isFunctionCallOutput = Schema.is(FunctionCallOutput)\nexport const isReasoning = Schema.is(Reasoning)\n\n// ---------------------------------------------------------------------------\n// Usage and stop reason\n// ---------------------------------------------------------------------------\n\nexport const InputTokensDetails = Schema.Struct({\n cached_tokens: Schema.optional(Schema.Number),\n})\nexport type InputTokensDetails = typeof InputTokensDetails.Type\n\nexport const OutputTokensDetails = Schema.Struct({\n reasoning_tokens: Schema.optional(Schema.Number),\n})\nexport type OutputTokensDetails = typeof OutputTokensDetails.Type\n\nexport const Usage = Schema.Struct({\n input_tokens: Schema.optional(Schema.Number),\n output_tokens: Schema.optional(Schema.Number),\n total_tokens: Schema.optional(Schema.Number),\n input_tokens_details: Schema.optional(InputTokensDetails),\n output_tokens_details: Schema.optional(OutputTokensDetails),\n})\nexport type Usage = typeof Usage.Type\n\nexport const StopReason = Schema.Literals([\n \"stop\",\n \"tool_calls\",\n \"max_tokens\",\n \"refusal\",\n /** Provider-side safety classifier flagged the output. */\n \"content_filter\",\n /** Server-enforced cap on tool calls per turn was hit. */\n \"max_tool_calls\",\n])\nexport type StopReason = typeof StopReason.Type\n\n// ---------------------------------------------------------------------------\n// Helper constructors\n// ---------------------------------------------------------------------------\n\nexport const userText = (text: string): Message => ({\n type: \"message\",\n role: \"user\",\n content: [{ type: \"input_text\", text }],\n})\n\nexport const systemText = (text: string): Message => ({\n type: \"message\",\n role: \"system\",\n content: [{ type: \"input_text\", text }],\n})\n\nexport const assistantText = (text: string): Message => ({\n type: \"message\",\n role: \"assistant\",\n content: [{ type: \"output_text\", text }],\n})\n\nexport const functionCallOutput = (call_id: string, output: string): FunctionCallOutput => ({\n type: \"function_call_output\",\n call_id,\n output,\n})\n"],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { n as __exportAll } from "../chunk-uyGKjUfl.mjs";
|
|
2
|
+
//#region src/domain/Media.ts
|
|
3
|
+
var Media_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
isMediaBase64: () => isMediaBase64,
|
|
5
|
+
isMediaBytes: () => isMediaBytes,
|
|
6
|
+
isMediaUrl: () => isMediaUrl
|
|
7
|
+
});
|
|
8
|
+
const isMediaUrl = (s) => s._tag === "url";
|
|
9
|
+
const isMediaBase64 = (s) => s._tag === "base64";
|
|
10
|
+
const isMediaBytes = (s) => s._tag === "bytes";
|
|
11
|
+
//#endregion
|
|
12
|
+
export { isMediaBase64, isMediaBytes, isMediaUrl, Media_exports as t };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=Media.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Media.mjs","names":[],"sources":["../../src/domain/Media.ts"],"sourcesContent":["/**\n * Cross-modality media reference shape.\n *\n * Every \"media at rest\" reference - image, audio, video, document - is one\n * of three variants:\n *\n * - `url` : a remote address (HTTP, GCS, etc.). The model fetches it.\n * `mimeType` is optional - servers usually set Content-Type.\n * Some providers (Gemini `fileData`) want it explicit.\n *\n * - `base64` : an inline base64-encoded payload. Always carries a\n * `mimeType` so the consumer knows how to decode.\n *\n * - `bytes` : raw `Uint8Array`. Provider layers normalize to base64 or\n * multipart upload at the wire boundary - users don't need\n * to encode themselves.\n *\n * Per-modality files (`Image.ts`, future `Audio.ts` / `Video.ts` /\n * `Document.ts`) instantiate this shape with their typed MIME union to\n * get autocomplete on common formats while keeping the structural type\n * uniform across modalities.\n *\n * Streaming media (live mic feed, streaming TTS playback) is *not*\n * modeled here. Streams carry effect parameters (`Stream<A, E, R>`) and\n * lifecycle (Scope, cancellation) that don't apply to media at rest. The\n * complementary type lives alongside this one as `*Stream` in each\n * per-modality file when those modalities land.\n *\n * Provider-uploaded asset references (OpenAI Files `file_id`, Gemini\n * Files API URIs, Anthropic file IDs) are also out of scope here -\n * they're a separate union (`FileRef`) added when needed.\n */\n\nexport type MediaUrl<M extends string = string> = {\n readonly _tag: \"url\"\n readonly url: string\n readonly mimeType?: M\n}\n\nexport type MediaBase64<M extends string = string> = {\n readonly _tag: \"base64\"\n readonly base64: string\n readonly mimeType: M\n}\n\nexport type MediaBytes<M extends string = string> = {\n readonly _tag: \"bytes\"\n readonly bytes: Uint8Array\n readonly mimeType: M\n}\n\nexport type MediaSource<M extends string = string> = MediaUrl<M> | MediaBase64<M> | MediaBytes<M>\n\nexport const isMediaUrl = <M extends string>(s: MediaSource<M>): s is MediaUrl<M> =>\n s._tag === \"url\"\n\nexport const isMediaBase64 = <M extends string>(s: MediaSource<M>): s is MediaBase64<M> =>\n s._tag === \"base64\"\n\nexport const isMediaBytes = <M extends string>(s: MediaSource<M>): s is MediaBytes<M> =>\n s._tag === \"bytes\"\n"],"mappings":";;;;;;;AAqDA,MAAa,cAAgC,MAC3C,EAAE,SAAS;AAEb,MAAa,iBAAmC,MAC9C,EAAE,SAAS;AAEb,MAAa,gBAAkC,MAC7C,EAAE,SAAS"}
|
package/dist/domain/Turn.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as functionCalls, d as textDeltas, f as toStructured, i as TurnEvent, l as isTurnComplete, n as RefusalRejected, o as appendTurn, r as Turn, s as assistantMessages, t as InteractionEvent, u as reasonings } from "../Turn-
|
|
1
|
+
import { c as functionCalls, d as textDeltas, f as toStructured, i as TurnEvent, l as isTurnComplete, n as RefusalRejected, o as appendTurn, r as Turn, s as assistantMessages, t as InteractionEvent, u as reasonings } from "../Turn-OPaILVIB.mjs";
|
|
2
2
|
export { InteractionEvent, RefusalRejected, Turn, TurnEvent, appendTurn, assistantMessages, functionCalls, isTurnComplete, reasonings, textDeltas, toStructured };
|
package/dist/domain/Turn.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __exportAll } from "../chunk-uyGKjUfl.mjs";
|
|
2
2
|
import { Item, StopReason, Usage, isOutputText, isRefusal } from "./Items.mjs";
|
|
3
3
|
import { parseJson } from "../structured-format/StructuredFormat.mjs";
|
|
4
4
|
import { Data, Effect, Result, Schema, Stream, pipe } from "effect";
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { i as ImageSource } from "../Image-BZmKfIdq.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/embedding-model/Embedding.d.ts
|
|
4
|
+
declare namespace Embedding_d_exports {
|
|
5
|
+
export { BinaryEmbedding, EmbedContentPart, EmbedInput, Embedding, Float32Embedding, Int8Embedding, MultivectorEmbedding, SparseEmbedding, Usage, isBinary, isFloat32, isInt8, isMultivector, isSparse };
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* One part of a mixed text+image input. Used inside `EmbedInput.content[]`
|
|
9
|
+
* for providers that accept interleaved modalities in a single embed call
|
|
10
|
+
* (Cohere v4, Voyage multimodal, Jina v4, Google `gemini-embedding-2`).
|
|
11
|
+
*/
|
|
12
|
+
type EmbedContentPart = {
|
|
13
|
+
readonly text: string;
|
|
14
|
+
} | {
|
|
15
|
+
readonly image: ImageSource;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* What you embed. The `string` shorthand covers the common text-only case;
|
|
19
|
+
* structured variants exist for image-only and mixed-modality inputs.
|
|
20
|
+
*
|
|
21
|
+
* Not every provider accepts every variant: text-only providers (OpenAI,
|
|
22
|
+
* Mixedbread today) handle `string` and `{ text }`; multimodal providers
|
|
23
|
+
* (Google, Jina v4, Voyage multimodal, Cohere v4) handle all four. A
|
|
24
|
+
* provider layer rejects shapes it can't encode as `AiError.InvalidRequest`.
|
|
25
|
+
*/
|
|
26
|
+
type EmbedInput = string | {
|
|
27
|
+
readonly text: string;
|
|
28
|
+
} | {
|
|
29
|
+
readonly image: ImageSource;
|
|
30
|
+
} | {
|
|
31
|
+
readonly content: ReadonlyArray<EmbedContentPart>;
|
|
32
|
+
};
|
|
33
|
+
/** Dense float32 vector. The default representation across all providers. */
|
|
34
|
+
type Float32Embedding = {
|
|
35
|
+
readonly _tag: "float32";
|
|
36
|
+
readonly vector: Float32Array;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Dense int8-quantized vector. ~4x smaller than float32 with minimal
|
|
40
|
+
* recall loss on most benchmarks.
|
|
41
|
+
*/
|
|
42
|
+
type Int8Embedding = {
|
|
43
|
+
readonly _tag: "int8";
|
|
44
|
+
readonly vector: Int8Array;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Dense binary-quantized vector. One bit per dimension, packed into bytes.
|
|
48
|
+
* ~32x smaller than float32; meaningful recall loss but useful for hot
|
|
49
|
+
* indexes paired with a float32 reranker pass.
|
|
50
|
+
*/
|
|
51
|
+
type BinaryEmbedding = {
|
|
52
|
+
readonly _tag: "binary";
|
|
53
|
+
readonly vector: Uint8Array;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Sparse vector. Token-keyed weights for hybrid search (dense + lexical-
|
|
57
|
+
* style sparse). The single hosted producer today is Jina's `elser-v2`
|
|
58
|
+
* model, which returns subword tokens (e.g. `"bread"`, `"##ing"`) with
|
|
59
|
+
* their relevance weights.
|
|
60
|
+
*
|
|
61
|
+
* The shape is `Record<string, number>` rather than `(indices, values)`
|
|
62
|
+
* because real hosted learned-sparse encoders (ELSER, SPLADE) emit token
|
|
63
|
+
* strings with no shared vocabulary index. Converting to integer indices
|
|
64
|
+
* would either need a vocabulary table the model doesn't expose, or
|
|
65
|
+
* lose the cross-vector matching semantics. If a provider ever exposes
|
|
66
|
+
* index-valued sparse vectors (Pinecone-style, where you bring your own
|
|
67
|
+
* vocab), add an `IndexSparseEmbedding` sibling arm with `_tag:
|
|
68
|
+
* "sparse-indexed"`.
|
|
69
|
+
*
|
|
70
|
+
* Score with `Vector.sparseCosine` — dot product over the intersection
|
|
71
|
+
* of keys, normalized by the L2 norms of both maps.
|
|
72
|
+
*/
|
|
73
|
+
type SparseEmbedding = {
|
|
74
|
+
readonly _tag: "sparse";
|
|
75
|
+
readonly weights: Readonly<Record<string, number>>;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Multivector / late-interaction output: one float32 vector per token.
|
|
79
|
+
* Score documents with `Vector.maxSim` (ColBERT-style: per query vector,
|
|
80
|
+
* max dot product across doc vectors, summed). Typically ~50-500 vectors
|
|
81
|
+
* per document, each shorter than a single-vector embedding (~128 dim
|
|
82
|
+
* vs ~1024).
|
|
83
|
+
*
|
|
84
|
+
* Quantized multivector forms aren't modeled for the same reason as
|
|
85
|
+
* sparse - nothing on hosted APIs ships them yet.
|
|
86
|
+
*/
|
|
87
|
+
type MultivectorEmbedding = {
|
|
88
|
+
readonly _tag: "multivector";
|
|
89
|
+
readonly vectors: ReadonlyArray<Float32Array>;
|
|
90
|
+
};
|
|
91
|
+
type Embedding = Float32Embedding | Int8Embedding | BinaryEmbedding | SparseEmbedding | MultivectorEmbedding;
|
|
92
|
+
declare const isFloat32: (e: Embedding) => e is Float32Embedding;
|
|
93
|
+
declare const isInt8: (e: Embedding) => e is Int8Embedding;
|
|
94
|
+
declare const isBinary: (e: Embedding) => e is BinaryEmbedding;
|
|
95
|
+
declare const isSparse: (e: Embedding) => e is SparseEmbedding;
|
|
96
|
+
declare const isMultivector: (e: Embedding) => e is MultivectorEmbedding;
|
|
97
|
+
/**
|
|
98
|
+
* Token usage for one embed / embedMany call. One value per HTTP request,
|
|
99
|
+
* not per input vector. Most providers populate `inputTokens`; the field
|
|
100
|
+
* is optional for those that don't (or for mock layers in tests).
|
|
101
|
+
*/
|
|
102
|
+
type Usage = {
|
|
103
|
+
readonly inputTokens?: number;
|
|
104
|
+
};
|
|
105
|
+
//#endregion
|
|
106
|
+
export { BinaryEmbedding, EmbedContentPart, EmbedInput, Embedding, Float32Embedding, Int8Embedding, MultivectorEmbedding, SparseEmbedding, Usage, isBinary, isFloat32, isInt8, isMultivector, isSparse, Embedding_d_exports as t };
|
|
107
|
+
//# sourceMappingURL=Embedding.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Embedding.d.mts","names":[],"sources":["../../src/embedding-model/Embedding.ts"],"mappings":";;;;;;;;;;;KAOY,gBAAA;EAAA,SAA8B,IAAA;AAAA;EAAA,SAA4B,KAAA,EAAO,WAAA;AAAA;;;;;;;;;;KAWjE,UAAA;EAAA,SAEG,IAAA;AAAA;EAAA,SACA,KAAA,EAAO,WAAA;AAAA;EAAA,SACP,OAAA,EAAS,aAAA,CAAc,gBAAA;AAAA;;KAY1B,gBAAA;EAAA,SACD,IAAA;EAAA,SACA,MAAA,EAAQ,YAAA;AAAA;;;;;KAOP,aAAA;EAAA,SACD,IAAA;EAAA,SACA,MAAA,EAAQ,SAAA;AAAA;;;;;;KAQP,eAAA;EAAA,SACD,IAAA;EAAA,SACA,MAAA,EAAQ,UAAA;AAAA;;;;;;AAZnB;;;;;;;;;AAUA;;;;KAuBY,eAAA;EAAA,SACD,IAAA;EAAA,SACA,OAAA,EAAS,QAAA,CAAS,MAAA;AAAA;;AAF7B;;;;;;;;;KAeY,oBAAA;EAAA,SACD,IAAA;EAAA,SACA,OAAA,EAAS,aAAA,CAAc,YAAA;AAAA;AAAA,KAGtB,SAAA,GACR,gBAAA,GACA,aAAA,GACA,eAAA,GACA,eAAA,GACA,oBAAA;AAAA,cAES,SAAA,GAAa,CAAA,EAAG,SAAA,KAAY,CAAA,IAAK,gBAAA;AAAA,cACjC,MAAA,GAAU,CAAA,EAAG,SAAA,KAAY,CAAA,IAAK,aAAA;AAAA,cAC9B,QAAA,GAAY,CAAA,EAAG,SAAA,KAAY,CAAA,IAAK,eAAA;AAAA,cAChC,QAAA,GAAY,CAAA,EAAG,SAAA,KAAY,CAAA,IAAK,eAAA;AAAA,cAChC,aAAA,GAAiB,CAAA,EAAG,SAAA,KAAY,CAAA,IAAK,oBAAA;;AAXlD;;;;KAkBY,KAAA;EAAA,SACD,WAAA;AAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { n as __exportAll } from "../chunk-uyGKjUfl.mjs";
|
|
2
|
+
//#region src/embedding-model/Embedding.ts
|
|
3
|
+
var Embedding_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
isBinary: () => isBinary,
|
|
5
|
+
isFloat32: () => isFloat32,
|
|
6
|
+
isInt8: () => isInt8,
|
|
7
|
+
isMultivector: () => isMultivector,
|
|
8
|
+
isSparse: () => isSparse
|
|
9
|
+
});
|
|
10
|
+
const isFloat32 = (e) => e._tag === "float32";
|
|
11
|
+
const isInt8 = (e) => e._tag === "int8";
|
|
12
|
+
const isBinary = (e) => e._tag === "binary";
|
|
13
|
+
const isSparse = (e) => e._tag === "sparse";
|
|
14
|
+
const isMultivector = (e) => e._tag === "multivector";
|
|
15
|
+
//#endregion
|
|
16
|
+
export { isBinary, isFloat32, isInt8, isMultivector, isSparse, Embedding_exports as t };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=Embedding.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Embedding.mjs","names":[],"sources":["../../src/embedding-model/Embedding.ts"],"sourcesContent":["import type { ImageSource } from \"../domain/Image.js\"\n\n/**\n * One part of a mixed text+image input. Used inside `EmbedInput.content[]`\n * for providers that accept interleaved modalities in a single embed call\n * (Cohere v4, Voyage multimodal, Jina v4, Google `gemini-embedding-2`).\n */\nexport type EmbedContentPart = { readonly text: string } | { readonly image: ImageSource }\n\n/**\n * What you embed. The `string` shorthand covers the common text-only case;\n * structured variants exist for image-only and mixed-modality inputs.\n *\n * Not every provider accepts every variant: text-only providers (OpenAI,\n * Mixedbread today) handle `string` and `{ text }`; multimodal providers\n * (Google, Jina v4, Voyage multimodal, Cohere v4) handle all four. A\n * provider layer rejects shapes it can't encode as `AiError.InvalidRequest`.\n */\nexport type EmbedInput =\n | string\n | { readonly text: string }\n | { readonly image: ImageSource }\n | { readonly content: ReadonlyArray<EmbedContentPart> }\n\n// ---------------------------------------------------------------------------\n// Embedding representations\n//\n// The `_tag` reflects the wire form the provider returned, *not* what the\n// consumer asked for - request `encoding: \"int8\"` and you get back an\n// `Int8Embedding`. Math primitives are typed against the named interfaces\n// (see `Vector.ts`) so e.g. `sparseCosine` only accepts `SparseEmbedding`.\n// ---------------------------------------------------------------------------\n\n/** Dense float32 vector. The default representation across all providers. */\nexport type Float32Embedding = {\n readonly _tag: \"float32\"\n readonly vector: Float32Array\n}\n\n/**\n * Dense int8-quantized vector. ~4x smaller than float32 with minimal\n * recall loss on most benchmarks.\n */\nexport type Int8Embedding = {\n readonly _tag: \"int8\"\n readonly vector: Int8Array\n}\n\n/**\n * Dense binary-quantized vector. One bit per dimension, packed into bytes.\n * ~32x smaller than float32; meaningful recall loss but useful for hot\n * indexes paired with a float32 reranker pass.\n */\nexport type BinaryEmbedding = {\n readonly _tag: \"binary\"\n readonly vector: Uint8Array\n}\n\n/**\n * Sparse vector. Token-keyed weights for hybrid search (dense + lexical-\n * style sparse). The single hosted producer today is Jina's `elser-v2`\n * model, which returns subword tokens (e.g. `\"bread\"`, `\"##ing\"`) with\n * their relevance weights.\n *\n * The shape is `Record<string, number>` rather than `(indices, values)`\n * because real hosted learned-sparse encoders (ELSER, SPLADE) emit token\n * strings with no shared vocabulary index. Converting to integer indices\n * would either need a vocabulary table the model doesn't expose, or\n * lose the cross-vector matching semantics. If a provider ever exposes\n * index-valued sparse vectors (Pinecone-style, where you bring your own\n * vocab), add an `IndexSparseEmbedding` sibling arm with `_tag:\n * \"sparse-indexed\"`.\n *\n * Score with `Vector.sparseCosine` — dot product over the intersection\n * of keys, normalized by the L2 norms of both maps.\n */\nexport type SparseEmbedding = {\n readonly _tag: \"sparse\"\n readonly weights: Readonly<Record<string, number>>\n}\n\n/**\n * Multivector / late-interaction output: one float32 vector per token.\n * Score documents with `Vector.maxSim` (ColBERT-style: per query vector,\n * max dot product across doc vectors, summed). Typically ~50-500 vectors\n * per document, each shorter than a single-vector embedding (~128 dim\n * vs ~1024).\n *\n * Quantized multivector forms aren't modeled for the same reason as\n * sparse - nothing on hosted APIs ships them yet.\n */\nexport type MultivectorEmbedding = {\n readonly _tag: \"multivector\"\n readonly vectors: ReadonlyArray<Float32Array>\n}\n\nexport type Embedding =\n | Float32Embedding\n | Int8Embedding\n | BinaryEmbedding\n | SparseEmbedding\n | MultivectorEmbedding\n\nexport const isFloat32 = (e: Embedding): e is Float32Embedding => e._tag === \"float32\"\nexport const isInt8 = (e: Embedding): e is Int8Embedding => e._tag === \"int8\"\nexport const isBinary = (e: Embedding): e is BinaryEmbedding => e._tag === \"binary\"\nexport const isSparse = (e: Embedding): e is SparseEmbedding => e._tag === \"sparse\"\nexport const isMultivector = (e: Embedding): e is MultivectorEmbedding => e._tag === \"multivector\"\n\n/**\n * Token usage for one embed / embedMany call. One value per HTTP request,\n * not per input vector. Most providers populate `inputTokens`; the field\n * is optional for those that don't (or for mock layers in tests).\n */\nexport type Usage = {\n readonly inputTokens?: number\n}\n"],"mappings":";;;;;;;;;AAuGA,MAAa,aAAa,MAAwC,EAAE,SAAS;AAC7E,MAAa,UAAU,MAAqC,EAAE,SAAS;AACvE,MAAa,YAAY,MAAuC,EAAE,SAAS;AAC3E,MAAa,YAAY,MAAuC,EAAE,SAAS;AAC3E,MAAa,iBAAiB,MAA4C,EAAE,SAAS"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { t as AiError } from "../AiError-CBuPHVKA.mjs";
|
|
2
|
+
import { EmbedInput, Embedding, Usage } from "./Embedding.mjs";
|
|
3
|
+
import { Context, Effect } from "effect";
|
|
4
|
+
|
|
5
|
+
//#region src/embedding-model/EmbeddingModel.d.ts
|
|
6
|
+
declare namespace EmbeddingModel_d_exports {
|
|
7
|
+
export { CommonEmbedManyRequest, CommonEmbedRequest, EmbedManyResponse, EmbedResponse, EmbeddingModel, EmbeddingModelService, Encoding, embed, embedMany };
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Output representation requested from the provider.
|
|
11
|
+
*
|
|
12
|
+
* Dense quantizations - same vector at different storage cost:
|
|
13
|
+
* - `float32` — universal default.
|
|
14
|
+
* - `int8` — ~4x smaller; minimal recall loss on most benchmarks.
|
|
15
|
+
* - `binary` — ~32x smaller; meaningful recall loss but pairs well with
|
|
16
|
+
* a float32 reranker pass over a small candidate set.
|
|
17
|
+
*
|
|
18
|
+
* Non-dense representations:
|
|
19
|
+
* - `sparse` — learned sparse vector for hybrid (dense + lexical) search.
|
|
20
|
+
* Currently Jina ELSER only on hosted APIs.
|
|
21
|
+
* - `multivector` — one vector per token for late-interaction (ColBERT-
|
|
22
|
+
* style) scoring via `Vector.maxSim`. Currently Jina v4 only.
|
|
23
|
+
*
|
|
24
|
+
* Each provider's typed request narrows this to its supported set at
|
|
25
|
+
* compile time (e.g. `JinaEncoding = "float32" | "binary" | "sparse" |
|
|
26
|
+
* "multivector"`). On the generic `EmbeddingModel` path, callers can
|
|
27
|
+
* pass any `Encoding` and the provider's API will reject mismatches at
|
|
28
|
+
* runtime.
|
|
29
|
+
*/
|
|
30
|
+
type Encoding = "float32" | "int8" | "binary" | "sparse" | "multivector";
|
|
31
|
+
/**
|
|
32
|
+
* Cross-provider single-embed request. Mirrors the shape of
|
|
33
|
+
* `LanguageModel.CommonRequest`: cross-cutting fields here, vendor
|
|
34
|
+
* specifics in the provider's typed request.
|
|
35
|
+
*
|
|
36
|
+
* Provider-specific extensions (Cohere widened `task` enum, Jina LoRA
|
|
37
|
+
* tasks, Mixedbread free-form `prompt`, etc.) live in that provider's own
|
|
38
|
+
* request interface, which extends this and narrows `model` / widens
|
|
39
|
+
* `task`.
|
|
40
|
+
*/
|
|
41
|
+
type CommonEmbedRequest = {
|
|
42
|
+
readonly input: EmbedInput;
|
|
43
|
+
/**
|
|
44
|
+
* Model identifier. Each provider narrows this to its typed literal
|
|
45
|
+
* union, so code that yields a typed provider tag gets autocompletion.
|
|
46
|
+
*/
|
|
47
|
+
readonly model: string;
|
|
48
|
+
/**
|
|
49
|
+
* Retrieval-task hint. Applies to the input. OpenAI ignores this;
|
|
50
|
+
* Mixedbread doesn't have it; Cohere v3+ requires it on the wire (typed
|
|
51
|
+
* as required in `CohereEmbedRequest`). Provider-specific task enums
|
|
52
|
+
* (classification, clustering, code retrieval, …) live on the
|
|
53
|
+
* provider's own request type.
|
|
54
|
+
*/
|
|
55
|
+
readonly task?: "query" | "document";
|
|
56
|
+
/**
|
|
57
|
+
* Matryoshka truncation. Default: provider's native dimension.
|
|
58
|
+
* Discrete-value providers (Cohere, Vertex `multimodalembedding@001`)
|
|
59
|
+
* narrow this to a literal union in their typed request.
|
|
60
|
+
*/
|
|
61
|
+
readonly dimensions?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Output representation - see {@link Encoding}. Dense float32 is the
|
|
64
|
+
* default; provider layers reject unsupported values up front with
|
|
65
|
+
* `InvalidRequest`.
|
|
66
|
+
*/
|
|
67
|
+
readonly encoding?: Encoding;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Cross-provider batch-embed request. One `task` for the whole batch -
|
|
71
|
+
* mixed-task batches aren't a real provider feature (rerankers exist for
|
|
72
|
+
* that).
|
|
73
|
+
*/
|
|
74
|
+
type CommonEmbedManyRequest = Omit<CommonEmbedRequest, "input"> & {
|
|
75
|
+
readonly inputs: ReadonlyArray<EmbedInput>;
|
|
76
|
+
};
|
|
77
|
+
type EmbedResponse = {
|
|
78
|
+
readonly embedding: Embedding;
|
|
79
|
+
readonly usage: Usage;
|
|
80
|
+
};
|
|
81
|
+
type EmbedManyResponse = {
|
|
82
|
+
readonly embeddings: ReadonlyArray<Embedding>;
|
|
83
|
+
readonly usage: Usage;
|
|
84
|
+
};
|
|
85
|
+
type EmbeddingModelService = {
|
|
86
|
+
readonly embed: (request: CommonEmbedRequest) => Effect.Effect<EmbedResponse, AiError>;
|
|
87
|
+
readonly embedMany: (request: CommonEmbedManyRequest) => Effect.Effect<EmbedManyResponse, AiError>;
|
|
88
|
+
};
|
|
89
|
+
declare const EmbeddingModel_base: Context.ServiceClass<EmbeddingModel, "@betalyra/effect-uai/EmbeddingModel", EmbeddingModelService>;
|
|
90
|
+
declare class EmbeddingModel extends EmbeddingModel_base {}
|
|
91
|
+
/** Embed a single input. */
|
|
92
|
+
declare const embed: (request: CommonEmbedRequest) => Effect.Effect<EmbedResponse, AiError, EmbeddingModel>;
|
|
93
|
+
/** Embed a batch in one provider call. Same `task` for every input. */
|
|
94
|
+
declare const embedMany: (request: CommonEmbedManyRequest) => Effect.Effect<EmbedManyResponse, AiError, EmbeddingModel>;
|
|
95
|
+
//#endregion
|
|
96
|
+
export { CommonEmbedManyRequest, CommonEmbedRequest, EmbedManyResponse, EmbedResponse, EmbeddingModel, EmbeddingModelService, Encoding, embed, embedMany, EmbeddingModel_d_exports as t };
|
|
97
|
+
//# sourceMappingURL=EmbeddingModel.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbeddingModel.d.mts","names":[],"sources":["../../src/embedding-model/EmbeddingModel.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA;;;;;AAYA;;KAZY,QAAA;;;;;;;;;;;KAYA,kBAAA;EAAA,SACD,KAAA,EAAO,UAAA;;;;;WAKP,KAAA;EA6BqB;;;;;;;EAAA,SArBrB,IAAA;EAqBgC;AAG3C;;;;EAH2C,SAfhC,UAAA;EAmBW;;;;;EAAA,SAbX,QAAA,GAAW,QAAA;AAAA;;;;;;KAQV,sBAAA,GAAyB,IAAA,CAAK,kBAAA;EAAA,SAC/B,MAAA,EAAQ,aAAA,CAAc,UAAA;AAAA;AAAA,KAGrB,aAAA;EAAA,SACD,SAAA,EAAW,SAAA;EAAA,SACX,KAAA,EAAO,KAAA;AAAA;AAAA,KAGN,iBAAA;EAAA,SACD,UAAA,EAAY,aAAA,CAAc,SAAA;EAAA,SAC1B,KAAA,EAAO,KAAA;AAAA;AAAA,KAGN,qBAAA;EAAA,SACD,KAAA,GAAQ,OAAA,EAAS,kBAAA,KAAuB,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe,OAAA;EAAA,SACrE,SAAA,GACP,OAAA,EAAS,sBAAA,KACN,MAAA,CAAO,MAAA,CAAO,iBAAA,EAAmB,OAAA;AAAA;AAAA,cACvC,mBAAA;cAEY,cAAA,SAAuB,mBAAA;;cAKvB,KAAA,GACX,OAAA,EAAS,kBAAA,KACR,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe,OAAA,EAAiB,cAAA;;cAIpC,SAAA,GACX,OAAA,EAAS,sBAAA,KACR,MAAA,CAAO,MAAA,CAAO,iBAAA,EAAmB,OAAA,EAAiB,cAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { n as __exportAll } from "../chunk-uyGKjUfl.mjs";
|
|
2
|
+
import { Context, Effect } from "effect";
|
|
3
|
+
//#region src/embedding-model/EmbeddingModel.ts
|
|
4
|
+
var EmbeddingModel_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
EmbeddingModel: () => EmbeddingModel,
|
|
6
|
+
embed: () => embed,
|
|
7
|
+
embedMany: () => embedMany
|
|
8
|
+
});
|
|
9
|
+
var EmbeddingModel = class extends Context.Service()("@betalyra/effect-uai/EmbeddingModel") {};
|
|
10
|
+
/** Embed a single input. */
|
|
11
|
+
const embed = (request) => Effect.flatMap(EmbeddingModel.asEffect(), (m) => m.embed(request));
|
|
12
|
+
/** Embed a batch in one provider call. Same `task` for every input. */
|
|
13
|
+
const embedMany = (request) => Effect.flatMap(EmbeddingModel.asEffect(), (m) => m.embedMany(request));
|
|
14
|
+
//#endregion
|
|
15
|
+
export { EmbeddingModel, embed, embedMany, EmbeddingModel_exports as t };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=EmbeddingModel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbeddingModel.mjs","names":[],"sources":["../../src/embedding-model/EmbeddingModel.ts"],"sourcesContent":["import { Context, Effect } from \"effect\"\nimport * as AiError from \"../domain/AiError.js\"\nimport type { Embedding, EmbedInput, Usage } from \"./Embedding.js\"\n\n/**\n * Output representation requested from the provider.\n *\n * Dense quantizations - same vector at different storage cost:\n * - `float32` — universal default.\n * - `int8` — ~4x smaller; minimal recall loss on most benchmarks.\n * - `binary` — ~32x smaller; meaningful recall loss but pairs well with\n * a float32 reranker pass over a small candidate set.\n *\n * Non-dense representations:\n * - `sparse` — learned sparse vector for hybrid (dense + lexical) search.\n * Currently Jina ELSER only on hosted APIs.\n * - `multivector` — one vector per token for late-interaction (ColBERT-\n * style) scoring via `Vector.maxSim`. Currently Jina v4 only.\n *\n * Each provider's typed request narrows this to its supported set at\n * compile time (e.g. `JinaEncoding = \"float32\" | \"binary\" | \"sparse\" |\n * \"multivector\"`). On the generic `EmbeddingModel` path, callers can\n * pass any `Encoding` and the provider's API will reject mismatches at\n * runtime.\n */\nexport type Encoding = \"float32\" | \"int8\" | \"binary\" | \"sparse\" | \"multivector\"\n\n/**\n * Cross-provider single-embed request. Mirrors the shape of\n * `LanguageModel.CommonRequest`: cross-cutting fields here, vendor\n * specifics in the provider's typed request.\n *\n * Provider-specific extensions (Cohere widened `task` enum, Jina LoRA\n * tasks, Mixedbread free-form `prompt`, etc.) live in that provider's own\n * request interface, which extends this and narrows `model` / widens\n * `task`.\n */\nexport type CommonEmbedRequest = {\n readonly input: EmbedInput\n /**\n * Model identifier. Each provider narrows this to its typed literal\n * union, so code that yields a typed provider tag gets autocompletion.\n */\n readonly model: string\n /**\n * Retrieval-task hint. Applies to the input. OpenAI ignores this;\n * Mixedbread doesn't have it; Cohere v3+ requires it on the wire (typed\n * as required in `CohereEmbedRequest`). Provider-specific task enums\n * (classification, clustering, code retrieval, …) live on the\n * provider's own request type.\n */\n readonly task?: \"query\" | \"document\"\n /**\n * Matryoshka truncation. Default: provider's native dimension.\n * Discrete-value providers (Cohere, Vertex `multimodalembedding@001`)\n * narrow this to a literal union in their typed request.\n */\n readonly dimensions?: number\n /**\n * Output representation - see {@link Encoding}. Dense float32 is the\n * default; provider layers reject unsupported values up front with\n * `InvalidRequest`.\n */\n readonly encoding?: Encoding\n}\n\n/**\n * Cross-provider batch-embed request. One `task` for the whole batch -\n * mixed-task batches aren't a real provider feature (rerankers exist for\n * that).\n */\nexport type CommonEmbedManyRequest = Omit<CommonEmbedRequest, \"input\"> & {\n readonly inputs: ReadonlyArray<EmbedInput>\n}\n\nexport type EmbedResponse = {\n readonly embedding: Embedding\n readonly usage: Usage\n}\n\nexport type EmbedManyResponse = {\n readonly embeddings: ReadonlyArray<Embedding>\n readonly usage: Usage\n}\n\nexport type EmbeddingModelService = {\n readonly embed: (request: CommonEmbedRequest) => Effect.Effect<EmbedResponse, AiError.AiError>\n readonly embedMany: (\n request: CommonEmbedManyRequest,\n ) => Effect.Effect<EmbedManyResponse, AiError.AiError>\n}\n\nexport class EmbeddingModel extends Context.Service<EmbeddingModel, EmbeddingModelService>()(\n \"@betalyra/effect-uai/EmbeddingModel\",\n) {}\n\n/** Embed a single input. */\nexport const embed = (\n request: CommonEmbedRequest,\n): Effect.Effect<EmbedResponse, AiError.AiError, EmbeddingModel> =>\n Effect.flatMap(EmbeddingModel.asEffect(), (m) => m.embed(request))\n\n/** Embed a batch in one provider call. Same `task` for every input. */\nexport const embedMany = (\n request: CommonEmbedManyRequest,\n): Effect.Effect<EmbedManyResponse, AiError.AiError, EmbeddingModel> =>\n Effect.flatMap(EmbeddingModel.asEffect(), (m) => m.embedMany(request))\n"],"mappings":";;;;;;;;AA4FA,IAAa,iBAAb,cAAoC,QAAQ,SAAgD,CAC1F,sCACD,CAAC;;AAGF,MAAa,SACX,YAEA,OAAO,QAAQ,eAAe,UAAU,GAAG,MAAM,EAAE,MAAM,QAAQ,CAAC;;AAGpE,MAAa,aACX,YAEA,OAAO,QAAQ,eAAe,UAAU,GAAG,MAAM,EAAE,UAAU,QAAQ,CAAC"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import { n as AiError_d_exports } from "./AiError-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { n as AiError_d_exports } from "./AiError-CBuPHVKA.mjs";
|
|
2
|
+
import { a as Media_d_exports } from "./Media-D_CpcM1Z.mjs";
|
|
3
|
+
import { o as Image_d_exports } from "./Image-BZmKfIdq.mjs";
|
|
4
|
+
import { f as Items_d_exports } from "./Items-CB8Bo3FI.mjs";
|
|
5
|
+
import { a as StructuredFormat_d_exports } from "./StructuredFormat-BWq5Hd1O.mjs";
|
|
6
|
+
import { a as Turn_d_exports } from "./Turn-OPaILVIB.mjs";
|
|
7
|
+
import { t as Embedding_d_exports } from "./embedding-model/Embedding.mjs";
|
|
8
|
+
import { t as EmbeddingModel_d_exports } from "./embedding-model/EmbeddingModel.mjs";
|
|
9
|
+
import { l as Tool_d_exports } from "./Tool-DjVufH7i.mjs";
|
|
6
10
|
import { t as LanguageModel_d_exports } from "./language-model/LanguageModel.mjs";
|
|
11
|
+
import { t as Vector_d_exports } from "./math/Vector.mjs";
|
|
7
12
|
import { t as Loop_d_exports } from "./loop/Loop.mjs";
|
|
8
|
-
import { t as
|
|
13
|
+
import { t as Outcome_d_exports } from "./tool/Outcome.mjs";
|
|
14
|
+
import { t as ToolEvent_d_exports } from "./tool/ToolEvent.mjs";
|
|
9
15
|
import { t as Toolkit_d_exports } from "./tool/Toolkit.mjs";
|
|
16
|
+
import { t as Resolvers_d_exports } from "./tool/Resolvers.mjs";
|
|
17
|
+
import { t as HistoryCheck_d_exports } from "./tool/HistoryCheck.mjs";
|
|
10
18
|
import { t as JSONL_d_exports } from "./streaming/JSONL.mjs";
|
|
11
19
|
import { t as Lines_d_exports } from "./streaming/Lines.mjs";
|
|
12
20
|
import { t as SSE_d_exports } from "./streaming/SSE.mjs";
|
|
13
21
|
import { t as Metrics_d_exports } from "./observability/Metrics.mjs";
|
|
14
|
-
export { AiError_d_exports as AiError, Items_d_exports as Items, JSONL_d_exports as JSONL, LanguageModel_d_exports as LanguageModel, Lines_d_exports as Lines, Loop_d_exports as Loop,
|
|
22
|
+
export { AiError_d_exports as AiError, Embedding_d_exports as Embedding, EmbeddingModel_d_exports as EmbeddingModel, HistoryCheck_d_exports as HistoryCheck, Image_d_exports as Image, Items_d_exports as Items, JSONL_d_exports as JSONL, LanguageModel_d_exports as LanguageModel, Lines_d_exports as Lines, Loop_d_exports as Loop, Media_d_exports as Media, Metrics_d_exports as Metrics, Outcome_d_exports as Outcome, Resolvers_d_exports as Resolvers, SSE_d_exports as SSE, StructuredFormat_d_exports as StructuredFormat, Tool_d_exports as Tool, ToolEvent_d_exports as ToolEvent, Toolkit_d_exports as Toolkit, Turn_d_exports as Turn, Vector_d_exports as Vector };
|