@abhishek944/pi-embeddings 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -8
- package/dist/execute.js +36 -1
- package/dist/extension.js +6 -37
- package/dist/index.d.ts +1 -1
- package/dist/mcp-server.js +1 -14
- package/dist/providers.d.ts +9 -2
- package/dist/providers.js +153 -3
- package/dist/response.d.ts +6 -0
- package/dist/response.js +43 -0
- package/dist/runtime.d.ts +22 -2
- package/dist/runtime.js +12 -3
- package/dist/schemas.d.ts +408 -81
- package/dist/schemas.js +46 -16
- package/dist/settings.js +3 -1
- package/dist/tool-contracts.d.ts +327 -184
- package/dist/tool-contracts.js +2 -11
- package/package.json +1 -1
- package/src/execute.ts +40 -1
- package/src/extension.ts +10 -45
- package/src/index.ts +1 -2
- package/src/mcp-server.ts +0 -19
- package/src/providers.ts +185 -3
- package/src/response.ts +51 -0
- package/src/runtime.ts +44 -6
- package/src/schemas.ts +68 -26
- package/src/settings.ts +4 -0
- package/src/tool-contracts.ts +1 -13
package/dist/tool-contracts.d.ts
CHANGED
|
@@ -1,200 +1,343 @@
|
|
|
1
|
-
import { Type } from 'typebox';
|
|
2
1
|
export declare const EMBED_TOOL = "embed";
|
|
3
2
|
export declare const EMBED_COMPARE_TOOL = "embed_compare";
|
|
4
|
-
export declare const EMBEDDINGS_DESCRIBE_TOOL = "embeddings_describe";
|
|
5
3
|
export declare const EMBED_TOOL_DESCRIPTION = "Embed one or more text inputs with the server-configured embedding route. Provider, model, fallback routes and credentials stay in trusted settings; this tool cannot override them. Returns vectors and their actual generating space as structured data. Full text is preserved; the package owns prefixing and provider batching. Use embed_compare only for an explicit comparison.";
|
|
6
4
|
export declare const EMBED_COMPARE_TOOL_DESCRIPTION = "Explicitly compare the same text inputs using exactly the configured compare routes. Every entry is a separate request and may incur charges. No implicit default, fallback, ranking or settings mutation.";
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
inputs: Type.TArray<Type.TString>;
|
|
5
|
+
export declare const embedParameters: import("typebox").TObject<{
|
|
6
|
+
inputs: import("typebox").TArray<import("typebox").TString>;
|
|
10
7
|
}>;
|
|
11
|
-
export declare const embedCompareParameters:
|
|
12
|
-
inputs:
|
|
8
|
+
export declare const embedCompareParameters: import("typebox").TObject<{
|
|
9
|
+
inputs: import("typebox").TArray<import("typebox").TString>;
|
|
13
10
|
}>;
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
11
|
+
export declare const embedOutput: import("typebox").TObject<{
|
|
12
|
+
schemaVersion: import("typebox").TLiteral<2>;
|
|
13
|
+
provider: import("typebox").TUnion<[import("typebox").TUnion<[import("typebox").TLiteral<"local">, import("typebox").TLiteral<"openai">, import("typebox").TLiteral<"sarvam">, import("typebox").TLiteral<"gateway">, import("typebox").TLiteral<"openrouter">, import("typebox").TLiteral<"cloudflare">]>, import("typebox").TNull]>;
|
|
14
|
+
model: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
15
|
+
space: import("typebox").TUnion<[import("typebox").TUnion<[import("typebox").TObject<{
|
|
16
|
+
provider: import("typebox").TLiteral<"local">;
|
|
17
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
18
|
+
revision: import("typebox").TString;
|
|
19
|
+
quantization: import("typebox").TLiteral<"Q8_0">;
|
|
20
|
+
runtime: import("typebox").TString;
|
|
21
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
22
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
23
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
24
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
25
|
+
}>, import("typebox").TObject<{
|
|
26
|
+
provider: import("typebox").TLiteral<"openai">;
|
|
27
|
+
model: import("typebox").TLiteral<"text-embedding-3-small">;
|
|
28
|
+
revision: import("typebox").TNull;
|
|
29
|
+
quantization: import("typebox").TNull;
|
|
30
|
+
runtime: import("typebox").TNull;
|
|
31
|
+
dimensions: import("typebox").TLiteral<1536>;
|
|
32
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
33
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
34
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
35
|
+
}>, import("typebox").TObject<{
|
|
36
|
+
provider: import("typebox").TLiteral<"sarvam">;
|
|
37
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
38
|
+
revision: import("typebox").TNull;
|
|
39
|
+
quantization: import("typebox").TNull;
|
|
40
|
+
runtime: import("typebox").TLiteral<"sarvam-v2">;
|
|
41
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
42
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
43
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
44
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
45
|
+
}>, import("typebox").TObject<{
|
|
46
|
+
provider: import("typebox").TLiteral<"cloudflare">;
|
|
47
|
+
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
48
|
+
revision: import("typebox").TNull;
|
|
49
|
+
quantization: import("typebox").TNull;
|
|
50
|
+
runtime: import("typebox").TLiteral<"cloudflare-workers-ai">;
|
|
51
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
52
|
+
pooling: import("typebox").TUnion<[import("typebox").TLiteral<"mean">, import("typebox").TLiteral<"cls">]>;
|
|
53
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
54
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
55
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
56
|
+
}>]>, import("typebox").TNull]>;
|
|
57
|
+
generations: import("typebox").TArray<import("typebox").TObject<{
|
|
58
|
+
provider: import("typebox").TUnion<[import("typebox").TLiteral<"local">, import("typebox").TLiteral<"openai">, import("typebox").TLiteral<"sarvam">, import("typebox").TLiteral<"gateway">, import("typebox").TLiteral<"openrouter">, import("typebox").TLiteral<"cloudflare">]>;
|
|
59
|
+
model: import("typebox").TString;
|
|
60
|
+
space: import("typebox").TUnion<[import("typebox").TObject<{
|
|
61
|
+
provider: import("typebox").TLiteral<"local">;
|
|
62
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
63
|
+
revision: import("typebox").TString;
|
|
64
|
+
quantization: import("typebox").TLiteral<"Q8_0">;
|
|
65
|
+
runtime: import("typebox").TString;
|
|
66
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
67
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
68
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
69
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
70
|
+
}>, import("typebox").TObject<{
|
|
71
|
+
provider: import("typebox").TLiteral<"openai">;
|
|
72
|
+
model: import("typebox").TLiteral<"text-embedding-3-small">;
|
|
73
|
+
revision: import("typebox").TNull;
|
|
74
|
+
quantization: import("typebox").TNull;
|
|
75
|
+
runtime: import("typebox").TNull;
|
|
76
|
+
dimensions: import("typebox").TLiteral<1536>;
|
|
77
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
78
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
79
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
80
|
+
}>, import("typebox").TObject<{
|
|
81
|
+
provider: import("typebox").TLiteral<"sarvam">;
|
|
82
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
83
|
+
revision: import("typebox").TNull;
|
|
84
|
+
quantization: import("typebox").TNull;
|
|
85
|
+
runtime: import("typebox").TLiteral<"sarvam-v2">;
|
|
86
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
87
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
88
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
89
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
90
|
+
}>, import("typebox").TObject<{
|
|
91
|
+
provider: import("typebox").TLiteral<"cloudflare">;
|
|
92
|
+
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
93
|
+
revision: import("typebox").TNull;
|
|
94
|
+
quantization: import("typebox").TNull;
|
|
95
|
+
runtime: import("typebox").TLiteral<"cloudflare-workers-ai">;
|
|
96
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
97
|
+
pooling: import("typebox").TUnion<[import("typebox").TLiteral<"mean">, import("typebox").TLiteral<"cls">]>;
|
|
98
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
99
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
100
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
53
101
|
}>]>;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
102
|
+
}>>;
|
|
103
|
+
outcomes: import("typebox").TArray<import("typebox").TUnion<[import("typebox").TObject<{
|
|
104
|
+
status: import("typebox").TLiteral<"success">;
|
|
105
|
+
index: import("typebox").TInteger;
|
|
106
|
+
vector: import("typebox").TArray<import("typebox").TNumber>;
|
|
107
|
+
route: import("typebox").TUnion<[import("typebox").TLiteral<"local">, import("typebox").TLiteral<"openai">, import("typebox").TLiteral<"sarvam">, import("typebox").TLiteral<"gateway">, import("typebox").TLiteral<"openrouter">, import("typebox").TLiteral<"cloudflare">]>;
|
|
108
|
+
model: import("typebox").TString;
|
|
109
|
+
space: import("typebox").TUnion<[import("typebox").TObject<{
|
|
110
|
+
provider: import("typebox").TLiteral<"local">;
|
|
111
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
112
|
+
revision: import("typebox").TString;
|
|
113
|
+
quantization: import("typebox").TLiteral<"Q8_0">;
|
|
114
|
+
runtime: import("typebox").TString;
|
|
115
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
116
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
117
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
118
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
119
|
+
}>, import("typebox").TObject<{
|
|
120
|
+
provider: import("typebox").TLiteral<"openai">;
|
|
121
|
+
model: import("typebox").TLiteral<"text-embedding-3-small">;
|
|
122
|
+
revision: import("typebox").TNull;
|
|
123
|
+
quantization: import("typebox").TNull;
|
|
124
|
+
runtime: import("typebox").TNull;
|
|
125
|
+
dimensions: import("typebox").TLiteral<1536>;
|
|
126
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
127
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
128
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
129
|
+
}>, import("typebox").TObject<{
|
|
130
|
+
provider: import("typebox").TLiteral<"sarvam">;
|
|
131
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
132
|
+
revision: import("typebox").TNull;
|
|
133
|
+
quantization: import("typebox").TNull;
|
|
134
|
+
runtime: import("typebox").TLiteral<"sarvam-v2">;
|
|
135
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
136
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
137
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
138
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
139
|
+
}>, import("typebox").TObject<{
|
|
140
|
+
provider: import("typebox").TLiteral<"cloudflare">;
|
|
141
|
+
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
142
|
+
revision: import("typebox").TNull;
|
|
143
|
+
quantization: import("typebox").TNull;
|
|
144
|
+
runtime: import("typebox").TLiteral<"cloudflare-workers-ai">;
|
|
145
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
146
|
+
pooling: import("typebox").TUnion<[import("typebox").TLiteral<"mean">, import("typebox").TLiteral<"cls">]>;
|
|
147
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
148
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
149
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
150
|
+
}>]>;
|
|
151
|
+
attemptId: import("typebox").TString;
|
|
152
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
153
|
+
}>, import("typebox").TObject<{
|
|
154
|
+
status: import("typebox").TLiteral<"error">;
|
|
155
|
+
index: import("typebox").TInteger;
|
|
156
|
+
code: import("typebox").TUnion<[import("typebox").TLiteral<"configuration-invalid">, import("typebox").TLiteral<"route-unconfigured">, import("typebox").TLiteral<"missing-credentials">, import("typebox").TLiteral<"http-auth">, import("typebox").TLiteral<"http-not-found">, import("typebox").TLiteral<"http-rate-limit">, import("typebox").TLiteral<"http-forbidden">, import("typebox").TLiteral<"http-bad-request">, import("typebox").TLiteral<"http-server-error">, import("typebox").TLiteral<"transport-failed">, import("typebox").TLiteral<"provider-response-invalid">, import("typebox").TLiteral<"provider-response-mismatch">, import("typebox").TLiteral<"vector-invalid">, import("typebox").TLiteral<"vector-zero">, import("typebox").TLiteral<"input-empty">, import("typebox").TLiteral<"input-too-long">, import("typebox").TLiteral<"tokenizer-roundtrip-failed">, import("typebox").TLiteral<"attribution-unavailable">, import("typebox").TLiteral<"local-resources-unavailable">, import("typebox").TLiteral<"local-model-mismatch">, import("typebox").TLiteral<"local-runtime-mismatch">, import("typebox").TLiteral<"local-startup-failed">, import("typebox").TLiteral<"local-cpu-startup-invalid">, import("typebox").TLiteral<"cancelled">, import("typebox").TLiteral<"unstarted">]>;
|
|
157
|
+
attemptId: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
61
158
|
}>]>>;
|
|
62
|
-
attempts:
|
|
63
|
-
id:
|
|
64
|
-
route:
|
|
65
|
-
model:
|
|
66
|
-
routeIndex:
|
|
67
|
-
status:
|
|
68
|
-
usage:
|
|
69
|
-
providerReportedInputTokens:
|
|
70
|
-
preparedInputTokens:
|
|
71
|
-
billedTokens:
|
|
72
|
-
}>,
|
|
73
|
-
errorCode:
|
|
159
|
+
attempts: import("typebox").TArray<import("typebox").TObject<{
|
|
160
|
+
id: import("typebox").TString;
|
|
161
|
+
route: import("typebox").TUnion<[import("typebox").TLiteral<"local">, import("typebox").TLiteral<"openai">, import("typebox").TLiteral<"sarvam">, import("typebox").TLiteral<"gateway">, import("typebox").TLiteral<"openrouter">, import("typebox").TLiteral<"cloudflare">]>;
|
|
162
|
+
model: import("typebox").TString;
|
|
163
|
+
routeIndex: import("typebox").TInteger;
|
|
164
|
+
status: import("typebox").TUnion<[import("typebox").TLiteral<"success">, import("typebox").TLiteral<"error">, import("typebox").TLiteral<"cancelled">]>;
|
|
165
|
+
usage: import("typebox").TUnion<[import("typebox").TObject<{
|
|
166
|
+
providerReportedInputTokens: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
167
|
+
preparedInputTokens: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
168
|
+
billedTokens: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
169
|
+
}>, import("typebox").TNull]>;
|
|
170
|
+
errorCode: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"configuration-invalid">, import("typebox").TLiteral<"route-unconfigured">, import("typebox").TLiteral<"missing-credentials">, import("typebox").TLiteral<"http-auth">, import("typebox").TLiteral<"http-not-found">, import("typebox").TLiteral<"http-rate-limit">, import("typebox").TLiteral<"http-forbidden">, import("typebox").TLiteral<"http-bad-request">, import("typebox").TLiteral<"http-server-error">, import("typebox").TLiteral<"transport-failed">, import("typebox").TLiteral<"provider-response-invalid">, import("typebox").TLiteral<"provider-response-mismatch">, import("typebox").TLiteral<"vector-invalid">, import("typebox").TLiteral<"vector-zero">, import("typebox").TLiteral<"input-empty">, import("typebox").TLiteral<"input-too-long">, import("typebox").TLiteral<"tokenizer-roundtrip-failed">, import("typebox").TLiteral<"attribution-unavailable">, import("typebox").TLiteral<"local-resources-unavailable">, import("typebox").TLiteral<"local-model-mismatch">, import("typebox").TLiteral<"local-runtime-mismatch">, import("typebox").TLiteral<"local-startup-failed">, import("typebox").TLiteral<"local-cpu-startup-invalid">, import("typebox").TLiteral<"cancelled">, import("typebox").TLiteral<"unstarted">]>>;
|
|
74
171
|
}>>;
|
|
75
172
|
}>;
|
|
76
|
-
export declare const embedCompareOutput:
|
|
77
|
-
schemaVersion:
|
|
78
|
-
entries:
|
|
79
|
-
route:
|
|
80
|
-
model:
|
|
81
|
-
status:
|
|
82
|
-
result:
|
|
83
|
-
schemaVersion:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
173
|
+
export declare const embedCompareOutput: import("typebox").TObject<{
|
|
174
|
+
schemaVersion: import("typebox").TLiteral<2>;
|
|
175
|
+
entries: import("typebox").TArray<import("typebox").TObject<{
|
|
176
|
+
route: import("typebox").TUnion<[import("typebox").TLiteral<"local">, import("typebox").TLiteral<"openai">, import("typebox").TLiteral<"sarvam">, import("typebox").TLiteral<"gateway">, import("typebox").TLiteral<"openrouter">, import("typebox").TLiteral<"cloudflare">]>;
|
|
177
|
+
model: import("typebox").TString;
|
|
178
|
+
status: import("typebox").TUnion<[import("typebox").TLiteral<"success">, import("typebox").TLiteral<"error">, import("typebox").TLiteral<"cancelled">]>;
|
|
179
|
+
result: import("typebox").TObject<{
|
|
180
|
+
schemaVersion: import("typebox").TLiteral<2>;
|
|
181
|
+
provider: import("typebox").TUnion<[import("typebox").TUnion<[import("typebox").TLiteral<"local">, import("typebox").TLiteral<"openai">, import("typebox").TLiteral<"sarvam">, import("typebox").TLiteral<"gateway">, import("typebox").TLiteral<"openrouter">, import("typebox").TLiteral<"cloudflare">]>, import("typebox").TNull]>;
|
|
182
|
+
model: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
183
|
+
space: import("typebox").TUnion<[import("typebox").TUnion<[import("typebox").TObject<{
|
|
184
|
+
provider: import("typebox").TLiteral<"local">;
|
|
185
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
186
|
+
revision: import("typebox").TString;
|
|
187
|
+
quantization: import("typebox").TLiteral<"Q8_0">;
|
|
188
|
+
runtime: import("typebox").TString;
|
|
189
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
190
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
191
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
192
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
193
|
+
}>, import("typebox").TObject<{
|
|
194
|
+
provider: import("typebox").TLiteral<"openai">;
|
|
195
|
+
model: import("typebox").TLiteral<"text-embedding-3-small">;
|
|
196
|
+
revision: import("typebox").TNull;
|
|
197
|
+
quantization: import("typebox").TNull;
|
|
198
|
+
runtime: import("typebox").TNull;
|
|
199
|
+
dimensions: import("typebox").TLiteral<1536>;
|
|
200
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
201
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
202
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
203
|
+
}>, import("typebox").TObject<{
|
|
204
|
+
provider: import("typebox").TLiteral<"sarvam">;
|
|
205
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
206
|
+
revision: import("typebox").TNull;
|
|
207
|
+
quantization: import("typebox").TNull;
|
|
208
|
+
runtime: import("typebox").TLiteral<"sarvam-v2">;
|
|
209
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
210
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
211
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
212
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
213
|
+
}>, import("typebox").TObject<{
|
|
214
|
+
provider: import("typebox").TLiteral<"cloudflare">;
|
|
215
|
+
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
216
|
+
revision: import("typebox").TNull;
|
|
217
|
+
quantization: import("typebox").TNull;
|
|
218
|
+
runtime: import("typebox").TLiteral<"cloudflare-workers-ai">;
|
|
219
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
220
|
+
pooling: import("typebox").TUnion<[import("typebox").TLiteral<"mean">, import("typebox").TLiteral<"cls">]>;
|
|
221
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
222
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
223
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
224
|
+
}>]>, import("typebox").TNull]>;
|
|
225
|
+
generations: import("typebox").TArray<import("typebox").TObject<{
|
|
226
|
+
provider: import("typebox").TUnion<[import("typebox").TLiteral<"local">, import("typebox").TLiteral<"openai">, import("typebox").TLiteral<"sarvam">, import("typebox").TLiteral<"gateway">, import("typebox").TLiteral<"openrouter">, import("typebox").TLiteral<"cloudflare">]>;
|
|
227
|
+
model: import("typebox").TString;
|
|
228
|
+
space: import("typebox").TUnion<[import("typebox").TObject<{
|
|
229
|
+
provider: import("typebox").TLiteral<"local">;
|
|
230
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
231
|
+
revision: import("typebox").TString;
|
|
232
|
+
quantization: import("typebox").TLiteral<"Q8_0">;
|
|
233
|
+
runtime: import("typebox").TString;
|
|
234
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
235
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
236
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
237
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
238
|
+
}>, import("typebox").TObject<{
|
|
239
|
+
provider: import("typebox").TLiteral<"openai">;
|
|
240
|
+
model: import("typebox").TLiteral<"text-embedding-3-small">;
|
|
241
|
+
revision: import("typebox").TNull;
|
|
242
|
+
quantization: import("typebox").TNull;
|
|
243
|
+
runtime: import("typebox").TNull;
|
|
244
|
+
dimensions: import("typebox").TLiteral<1536>;
|
|
245
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
246
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
247
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
248
|
+
}>, import("typebox").TObject<{
|
|
249
|
+
provider: import("typebox").TLiteral<"sarvam">;
|
|
250
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
251
|
+
revision: import("typebox").TNull;
|
|
252
|
+
quantization: import("typebox").TNull;
|
|
253
|
+
runtime: import("typebox").TLiteral<"sarvam-v2">;
|
|
254
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
255
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
256
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
257
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
258
|
+
}>, import("typebox").TObject<{
|
|
259
|
+
provider: import("typebox").TLiteral<"cloudflare">;
|
|
260
|
+
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
261
|
+
revision: import("typebox").TNull;
|
|
262
|
+
quantization: import("typebox").TNull;
|
|
263
|
+
runtime: import("typebox").TLiteral<"cloudflare-workers-ai">;
|
|
264
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
265
|
+
pooling: import("typebox").TUnion<[import("typebox").TLiteral<"mean">, import("typebox").TLiteral<"cls">]>;
|
|
266
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
267
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
268
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
269
|
+
}>]>;
|
|
270
|
+
}>>;
|
|
271
|
+
outcomes: import("typebox").TArray<import("typebox").TUnion<[import("typebox").TObject<{
|
|
272
|
+
status: import("typebox").TLiteral<"success">;
|
|
273
|
+
index: import("typebox").TInteger;
|
|
274
|
+
vector: import("typebox").TArray<import("typebox").TNumber>;
|
|
275
|
+
route: import("typebox").TUnion<[import("typebox").TLiteral<"local">, import("typebox").TLiteral<"openai">, import("typebox").TLiteral<"sarvam">, import("typebox").TLiteral<"gateway">, import("typebox").TLiteral<"openrouter">, import("typebox").TLiteral<"cloudflare">]>;
|
|
276
|
+
model: import("typebox").TString;
|
|
277
|
+
space: import("typebox").TUnion<[import("typebox").TObject<{
|
|
278
|
+
provider: import("typebox").TLiteral<"local">;
|
|
279
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
280
|
+
revision: import("typebox").TString;
|
|
281
|
+
quantization: import("typebox").TLiteral<"Q8_0">;
|
|
282
|
+
runtime: import("typebox").TString;
|
|
283
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
284
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
285
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
286
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
287
|
+
}>, import("typebox").TObject<{
|
|
288
|
+
provider: import("typebox").TLiteral<"openai">;
|
|
289
|
+
model: import("typebox").TLiteral<"text-embedding-3-small">;
|
|
290
|
+
revision: import("typebox").TNull;
|
|
291
|
+
quantization: import("typebox").TNull;
|
|
292
|
+
runtime: import("typebox").TNull;
|
|
293
|
+
dimensions: import("typebox").TLiteral<1536>;
|
|
294
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
295
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
296
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
297
|
+
}>, import("typebox").TObject<{
|
|
298
|
+
provider: import("typebox").TLiteral<"sarvam">;
|
|
299
|
+
model: import("typebox").TLiteral<"embeddinggemma-2">;
|
|
300
|
+
revision: import("typebox").TNull;
|
|
301
|
+
quantization: import("typebox").TNull;
|
|
302
|
+
runtime: import("typebox").TLiteral<"sarvam-v2">;
|
|
303
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
304
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
305
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
306
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
307
|
+
}>, import("typebox").TObject<{
|
|
308
|
+
provider: import("typebox").TLiteral<"cloudflare">;
|
|
309
|
+
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
310
|
+
revision: import("typebox").TNull;
|
|
311
|
+
quantization: import("typebox").TNull;
|
|
312
|
+
runtime: import("typebox").TLiteral<"cloudflare-workers-ai">;
|
|
313
|
+
dimensions: import("typebox").TLiteral<768>;
|
|
314
|
+
pooling: import("typebox").TUnion<[import("typebox").TLiteral<"mean">, import("typebox").TLiteral<"cls">]>;
|
|
315
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
316
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
317
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
120
318
|
}>]>;
|
|
121
|
-
attemptId:
|
|
122
|
-
normalization:
|
|
123
|
-
}>,
|
|
124
|
-
status:
|
|
125
|
-
index:
|
|
126
|
-
code:
|
|
127
|
-
attemptId:
|
|
319
|
+
attemptId: import("typebox").TString;
|
|
320
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
321
|
+
}>, import("typebox").TObject<{
|
|
322
|
+
status: import("typebox").TLiteral<"error">;
|
|
323
|
+
index: import("typebox").TInteger;
|
|
324
|
+
code: import("typebox").TUnion<[import("typebox").TLiteral<"configuration-invalid">, import("typebox").TLiteral<"route-unconfigured">, import("typebox").TLiteral<"missing-credentials">, import("typebox").TLiteral<"http-auth">, import("typebox").TLiteral<"http-not-found">, import("typebox").TLiteral<"http-rate-limit">, import("typebox").TLiteral<"http-forbidden">, import("typebox").TLiteral<"http-bad-request">, import("typebox").TLiteral<"http-server-error">, import("typebox").TLiteral<"transport-failed">, import("typebox").TLiteral<"provider-response-invalid">, import("typebox").TLiteral<"provider-response-mismatch">, import("typebox").TLiteral<"vector-invalid">, import("typebox").TLiteral<"vector-zero">, import("typebox").TLiteral<"input-empty">, import("typebox").TLiteral<"input-too-long">, import("typebox").TLiteral<"tokenizer-roundtrip-failed">, import("typebox").TLiteral<"attribution-unavailable">, import("typebox").TLiteral<"local-resources-unavailable">, import("typebox").TLiteral<"local-model-mismatch">, import("typebox").TLiteral<"local-runtime-mismatch">, import("typebox").TLiteral<"local-startup-failed">, import("typebox").TLiteral<"local-cpu-startup-invalid">, import("typebox").TLiteral<"cancelled">, import("typebox").TLiteral<"unstarted">]>;
|
|
325
|
+
attemptId: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
128
326
|
}>]>>;
|
|
129
|
-
attempts:
|
|
130
|
-
id:
|
|
131
|
-
route:
|
|
132
|
-
model:
|
|
133
|
-
routeIndex:
|
|
134
|
-
status:
|
|
135
|
-
usage:
|
|
136
|
-
providerReportedInputTokens:
|
|
137
|
-
preparedInputTokens:
|
|
138
|
-
billedTokens:
|
|
139
|
-
}>,
|
|
140
|
-
errorCode:
|
|
327
|
+
attempts: import("typebox").TArray<import("typebox").TObject<{
|
|
328
|
+
id: import("typebox").TString;
|
|
329
|
+
route: import("typebox").TUnion<[import("typebox").TLiteral<"local">, import("typebox").TLiteral<"openai">, import("typebox").TLiteral<"sarvam">, import("typebox").TLiteral<"gateway">, import("typebox").TLiteral<"openrouter">, import("typebox").TLiteral<"cloudflare">]>;
|
|
330
|
+
model: import("typebox").TString;
|
|
331
|
+
routeIndex: import("typebox").TInteger;
|
|
332
|
+
status: import("typebox").TUnion<[import("typebox").TLiteral<"success">, import("typebox").TLiteral<"error">, import("typebox").TLiteral<"cancelled">]>;
|
|
333
|
+
usage: import("typebox").TUnion<[import("typebox").TObject<{
|
|
334
|
+
providerReportedInputTokens: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
335
|
+
preparedInputTokens: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
336
|
+
billedTokens: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
337
|
+
}>, import("typebox").TNull]>;
|
|
338
|
+
errorCode: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"configuration-invalid">, import("typebox").TLiteral<"route-unconfigured">, import("typebox").TLiteral<"missing-credentials">, import("typebox").TLiteral<"http-auth">, import("typebox").TLiteral<"http-not-found">, import("typebox").TLiteral<"http-rate-limit">, import("typebox").TLiteral<"http-forbidden">, import("typebox").TLiteral<"http-bad-request">, import("typebox").TLiteral<"http-server-error">, import("typebox").TLiteral<"transport-failed">, import("typebox").TLiteral<"provider-response-invalid">, import("typebox").TLiteral<"provider-response-mismatch">, import("typebox").TLiteral<"vector-invalid">, import("typebox").TLiteral<"vector-zero">, import("typebox").TLiteral<"input-empty">, import("typebox").TLiteral<"input-too-long">, import("typebox").TLiteral<"tokenizer-roundtrip-failed">, import("typebox").TLiteral<"attribution-unavailable">, import("typebox").TLiteral<"local-resources-unavailable">, import("typebox").TLiteral<"local-model-mismatch">, import("typebox").TLiteral<"local-runtime-mismatch">, import("typebox").TLiteral<"local-startup-failed">, import("typebox").TLiteral<"local-cpu-startup-invalid">, import("typebox").TLiteral<"cancelled">, import("typebox").TLiteral<"unstarted">]>>;
|
|
141
339
|
}>>;
|
|
142
340
|
}>;
|
|
143
341
|
}>>;
|
|
144
342
|
}>;
|
|
145
|
-
export declare const
|
|
146
|
-
schemaVersion: Type.TLiteral<1>;
|
|
147
|
-
ready: Type.TBoolean;
|
|
148
|
-
selected: Type.TObject<{
|
|
149
|
-
provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">]>;
|
|
150
|
-
model: Type.TString;
|
|
151
|
-
}>;
|
|
152
|
-
space: Type.TUnion<[Type.TUnion<[Type.TObject<{
|
|
153
|
-
provider: Type.TLiteral<"local">;
|
|
154
|
-
model: Type.TLiteral<"embeddinggemma-2">;
|
|
155
|
-
revision: Type.TString;
|
|
156
|
-
quantization: Type.TLiteral<"Q8_0">;
|
|
157
|
-
runtime: Type.TString;
|
|
158
|
-
dimensions: Type.TLiteral<768>;
|
|
159
|
-
format: Type.TLiteral<"host-display-attributes-v1">;
|
|
160
|
-
prefix: Type.TLiteral<"title: none | text: ">;
|
|
161
|
-
normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
|
|
162
|
-
}>, Type.TObject<{
|
|
163
|
-
provider: Type.TLiteral<"openai">;
|
|
164
|
-
model: Type.TLiteral<"text-embedding-3-small">;
|
|
165
|
-
revision: Type.TNull;
|
|
166
|
-
quantization: Type.TNull;
|
|
167
|
-
runtime: Type.TNull;
|
|
168
|
-
dimensions: Type.TLiteral<1536>;
|
|
169
|
-
format: Type.TLiteral<"host-display-attributes-v1">;
|
|
170
|
-
prefix: Type.TLiteral<"title: none | text: ">;
|
|
171
|
-
normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
|
|
172
|
-
}>, Type.TObject<{
|
|
173
|
-
provider: Type.TLiteral<"sarvam">;
|
|
174
|
-
model: Type.TLiteral<"embeddinggemma-2">;
|
|
175
|
-
revision: Type.TNull;
|
|
176
|
-
quantization: Type.TNull;
|
|
177
|
-
runtime: Type.TLiteral<"sarvam-v2">;
|
|
178
|
-
dimensions: Type.TLiteral<768>;
|
|
179
|
-
format: Type.TLiteral<"host-display-attributes-v1">;
|
|
180
|
-
prefix: Type.TLiteral<"title: none | text: ">;
|
|
181
|
-
normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
|
|
182
|
-
}>]>, Type.TNull]>;
|
|
183
|
-
default: Type.TObject<{
|
|
184
|
-
provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">]>;
|
|
185
|
-
model: Type.TString;
|
|
186
|
-
}>;
|
|
187
|
-
fallback: Type.TArray<Type.TObject<{
|
|
188
|
-
provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">]>;
|
|
189
|
-
model: Type.TString;
|
|
190
|
-
}>>;
|
|
191
|
-
compare: Type.TArray<Type.TObject<{
|
|
192
|
-
provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">]>;
|
|
193
|
-
model: Type.TString;
|
|
194
|
-
}>>;
|
|
195
|
-
diagnostics: Type.TArray<Type.TObject<{
|
|
196
|
-
code: Type.TString;
|
|
197
|
-
severity: Type.TUnion<[Type.TLiteral<"error">, Type.TLiteral<"warning">, Type.TLiteral<"info">]>;
|
|
198
|
-
}>>;
|
|
199
|
-
}>;
|
|
200
|
-
export declare const EMBEDDINGS_TOOL_NAMES: readonly ["embed", "embed_compare", "embeddings_describe"];
|
|
343
|
+
export declare const EMBEDDINGS_TOOL_NAMES: readonly ["embed", "embed_compare"];
|
package/dist/tool-contracts.js
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { embeddingDescribeSchema, embeddingCompareResultSchema, embeddingRequestSchema, embeddingResultSchema, } from './schemas.js';
|
|
1
|
+
import { embeddingCompareResultSchema, embeddingRequestSchema, embeddingResultSchema, } from './schemas.js';
|
|
3
2
|
export const EMBED_TOOL = 'embed';
|
|
4
3
|
export const EMBED_COMPARE_TOOL = 'embed_compare';
|
|
5
|
-
export const EMBEDDINGS_DESCRIBE_TOOL = 'embeddings_describe';
|
|
6
4
|
export const EMBED_TOOL_DESCRIPTION = 'Embed one or more text inputs with the server-configured embedding route. Provider, model, fallback routes and credentials stay in trusted settings; this tool cannot override them. Returns vectors and their actual generating space as structured data. Full text is preserved; the package owns prefixing and provider batching. Use embed_compare only for an explicit comparison.';
|
|
7
5
|
export const EMBED_COMPARE_TOOL_DESCRIPTION = 'Explicitly compare the same text inputs using exactly the configured compare routes. Every entry is a separate request and may incur charges. No implicit default, fallback, ranking or settings mutation.';
|
|
8
|
-
export const EMBEDDINGS_DESCRIBE_TOOL_DESCRIPTION = 'Report the selected configured embedding route, generating space and provider-free readiness diagnostics without inference or credentials. Information is not a reservation or a caller storage policy.';
|
|
9
6
|
export const embedParameters = embeddingRequestSchema;
|
|
10
7
|
export const embedCompareParameters = embeddingRequestSchema;
|
|
11
|
-
export const embeddingsDescribeParameters = Type.Object({}, { additionalProperties: false });
|
|
12
8
|
export const embedOutput = embeddingResultSchema;
|
|
13
9
|
export const embedCompareOutput = embeddingCompareResultSchema;
|
|
14
|
-
export const
|
|
15
|
-
export const EMBEDDINGS_TOOL_NAMES = [
|
|
16
|
-
EMBED_TOOL,
|
|
17
|
-
EMBED_COMPARE_TOOL,
|
|
18
|
-
EMBEDDINGS_DESCRIBE_TOOL,
|
|
19
|
-
];
|
|
10
|
+
export const EMBEDDINGS_TOOL_NAMES = [EMBED_TOOL, EMBED_COMPARE_TOOL];
|