@abhishek944/pi-embeddings 0.2.0 → 0.5.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 +50 -5
- package/dist/execute.js +22 -3
- package/dist/extension.js +25 -7
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/provider-types.d.ts +4 -0
- package/dist/providers.d.ts +17 -4
- package/dist/providers.js +257 -4
- package/dist/response.d.ts +26 -0
- package/dist/response.js +135 -2
- package/dist/runtime.d.ts +6 -1
- package/dist/runtime.js +8 -3
- package/dist/schemas.d.ts +570 -22
- package/dist/schemas.js +156 -0
- package/dist/settings-write.js +2 -2
- package/dist/settings.js +8 -1
- package/dist/tool-contracts.d.ts +261 -9
- package/dist/vertex-provider.d.ts +18 -0
- package/dist/vertex-provider.js +139 -0
- package/package.json +10 -2
- package/src/execute.ts +21 -3
- package/src/extension.ts +45 -7
- package/src/index.ts +16 -0
- package/src/provider-types.ts +7 -0
- package/src/providers.ts +338 -3
- package/src/response.ts +156 -2
- package/src/runtime.ts +25 -6
- package/src/schemas.ts +199 -0
- package/src/settings-write.ts +2 -2
- package/src/settings.ts +10 -0
- package/src/vertex-provider.ts +152 -0
package/dist/tool-contracts.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const embedCompareParameters: import("typebox").TObject<{
|
|
|
10
10
|
}>;
|
|
11
11
|
export declare const embedOutput: import("typebox").TObject<{
|
|
12
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]>;
|
|
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").TLiteral<"gemini">, import("typebox").TLiteral<"vertex">, import("typebox").TLiteral<"opencode">, import("typebox").TLiteral<"opencode-go">]>, import("typebox").TNull]>;
|
|
14
14
|
model: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
15
15
|
space: import("typebox").TUnion<[import("typebox").TUnion<[import("typebox").TObject<{
|
|
16
16
|
provider: import("typebox").TLiteral<"local">;
|
|
@@ -42,6 +42,28 @@ export declare const embedOutput: import("typebox").TObject<{
|
|
|
42
42
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
43
43
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
44
44
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
45
|
+
}>, import("typebox").TObject<{
|
|
46
|
+
provider: import("typebox").TLiteral<"gemini">;
|
|
47
|
+
runtime: import("typebox").TLiteral<"gemini-api-v1beta">;
|
|
48
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
49
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
50
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
51
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
52
|
+
revision: import("typebox").TNull;
|
|
53
|
+
quantization: import("typebox").TNull;
|
|
54
|
+
dimensions: import("typebox").TInteger;
|
|
55
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
56
|
+
}>, import("typebox").TObject<{
|
|
57
|
+
provider: import("typebox").TLiteral<"vertex">;
|
|
58
|
+
runtime: import("typebox").TLiteral<"vertex-ai-v1">;
|
|
59
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
60
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
61
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
62
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
63
|
+
revision: import("typebox").TNull;
|
|
64
|
+
quantization: import("typebox").TNull;
|
|
65
|
+
dimensions: import("typebox").TInteger;
|
|
66
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
45
67
|
}>, import("typebox").TObject<{
|
|
46
68
|
provider: import("typebox").TLiteral<"cloudflare">;
|
|
47
69
|
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
@@ -53,9 +75,29 @@ export declare const embedOutput: import("typebox").TObject<{
|
|
|
53
75
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
54
76
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
55
77
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
78
|
+
}>, import("typebox").TObject<{
|
|
79
|
+
provider: import("typebox").TLiteral<"opencode">;
|
|
80
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"text-embedding-3-large">, import("typebox").TLiteral<"gemini-embedding-2">, import("typebox").TLiteral<"gemini-embedding-001">, import("typebox").TLiteral<"codestral-embed">, import("typebox").TLiteral<"mistral-embed">, import("typebox").TLiteral<"cohere-embed-v5-pro">, import("typebox").TLiteral<"cohere-embed-v5-fast">, import("typebox").TLiteral<"voyage-4">, import("typebox").TLiteral<"voyage-code-4">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"bge-m3">]>;
|
|
81
|
+
runtime: import("typebox").TLiteral<"opencode-console-embeddings-v1">;
|
|
82
|
+
revision: import("typebox").TNull;
|
|
83
|
+
quantization: import("typebox").TNull;
|
|
84
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
85
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
86
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
87
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
88
|
+
}>, import("typebox").TObject<{
|
|
89
|
+
provider: import("typebox").TLiteral<"opencode-go">;
|
|
90
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"gemini-embedding-2">]>;
|
|
91
|
+
runtime: import("typebox").TLiteral<"opencode-go-embeddings-v1">;
|
|
92
|
+
revision: import("typebox").TNull;
|
|
93
|
+
quantization: import("typebox").TNull;
|
|
94
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
95
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
96
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
97
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
56
98
|
}>]>, import("typebox").TNull]>;
|
|
57
99
|
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">]>;
|
|
100
|
+
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">, import("typebox").TLiteral<"gemini">, import("typebox").TLiteral<"vertex">, import("typebox").TLiteral<"opencode">, import("typebox").TLiteral<"opencode-go">]>;
|
|
59
101
|
model: import("typebox").TString;
|
|
60
102
|
space: import("typebox").TUnion<[import("typebox").TObject<{
|
|
61
103
|
provider: import("typebox").TLiteral<"local">;
|
|
@@ -87,6 +129,28 @@ export declare const embedOutput: import("typebox").TObject<{
|
|
|
87
129
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
88
130
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
89
131
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
132
|
+
}>, import("typebox").TObject<{
|
|
133
|
+
provider: import("typebox").TLiteral<"gemini">;
|
|
134
|
+
runtime: import("typebox").TLiteral<"gemini-api-v1beta">;
|
|
135
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
136
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
137
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
138
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
139
|
+
revision: import("typebox").TNull;
|
|
140
|
+
quantization: import("typebox").TNull;
|
|
141
|
+
dimensions: import("typebox").TInteger;
|
|
142
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
143
|
+
}>, import("typebox").TObject<{
|
|
144
|
+
provider: import("typebox").TLiteral<"vertex">;
|
|
145
|
+
runtime: import("typebox").TLiteral<"vertex-ai-v1">;
|
|
146
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
147
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
148
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
149
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
150
|
+
revision: import("typebox").TNull;
|
|
151
|
+
quantization: import("typebox").TNull;
|
|
152
|
+
dimensions: import("typebox").TInteger;
|
|
153
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
90
154
|
}>, import("typebox").TObject<{
|
|
91
155
|
provider: import("typebox").TLiteral<"cloudflare">;
|
|
92
156
|
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
@@ -98,13 +162,33 @@ export declare const embedOutput: import("typebox").TObject<{
|
|
|
98
162
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
99
163
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
100
164
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
165
|
+
}>, import("typebox").TObject<{
|
|
166
|
+
provider: import("typebox").TLiteral<"opencode">;
|
|
167
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"text-embedding-3-large">, import("typebox").TLiteral<"gemini-embedding-2">, import("typebox").TLiteral<"gemini-embedding-001">, import("typebox").TLiteral<"codestral-embed">, import("typebox").TLiteral<"mistral-embed">, import("typebox").TLiteral<"cohere-embed-v5-pro">, import("typebox").TLiteral<"cohere-embed-v5-fast">, import("typebox").TLiteral<"voyage-4">, import("typebox").TLiteral<"voyage-code-4">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"bge-m3">]>;
|
|
168
|
+
runtime: import("typebox").TLiteral<"opencode-console-embeddings-v1">;
|
|
169
|
+
revision: import("typebox").TNull;
|
|
170
|
+
quantization: import("typebox").TNull;
|
|
171
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
172
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
173
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
174
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
175
|
+
}>, import("typebox").TObject<{
|
|
176
|
+
provider: import("typebox").TLiteral<"opencode-go">;
|
|
177
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"gemini-embedding-2">]>;
|
|
178
|
+
runtime: import("typebox").TLiteral<"opencode-go-embeddings-v1">;
|
|
179
|
+
revision: import("typebox").TNull;
|
|
180
|
+
quantization: import("typebox").TNull;
|
|
181
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
182
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
183
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
184
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
101
185
|
}>]>;
|
|
102
186
|
}>>;
|
|
103
187
|
outcomes: import("typebox").TArray<import("typebox").TUnion<[import("typebox").TObject<{
|
|
104
188
|
status: import("typebox").TLiteral<"success">;
|
|
105
189
|
index: import("typebox").TInteger;
|
|
106
190
|
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">]>;
|
|
191
|
+
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">, import("typebox").TLiteral<"gemini">, import("typebox").TLiteral<"vertex">, import("typebox").TLiteral<"opencode">, import("typebox").TLiteral<"opencode-go">]>;
|
|
108
192
|
model: import("typebox").TString;
|
|
109
193
|
space: import("typebox").TUnion<[import("typebox").TObject<{
|
|
110
194
|
provider: import("typebox").TLiteral<"local">;
|
|
@@ -136,6 +220,28 @@ export declare const embedOutput: import("typebox").TObject<{
|
|
|
136
220
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
137
221
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
138
222
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
223
|
+
}>, import("typebox").TObject<{
|
|
224
|
+
provider: import("typebox").TLiteral<"gemini">;
|
|
225
|
+
runtime: import("typebox").TLiteral<"gemini-api-v1beta">;
|
|
226
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
227
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
228
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
229
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
230
|
+
revision: import("typebox").TNull;
|
|
231
|
+
quantization: import("typebox").TNull;
|
|
232
|
+
dimensions: import("typebox").TInteger;
|
|
233
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
234
|
+
}>, import("typebox").TObject<{
|
|
235
|
+
provider: import("typebox").TLiteral<"vertex">;
|
|
236
|
+
runtime: import("typebox").TLiteral<"vertex-ai-v1">;
|
|
237
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
238
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
239
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
240
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
241
|
+
revision: import("typebox").TNull;
|
|
242
|
+
quantization: import("typebox").TNull;
|
|
243
|
+
dimensions: import("typebox").TInteger;
|
|
244
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
139
245
|
}>, import("typebox").TObject<{
|
|
140
246
|
provider: import("typebox").TLiteral<"cloudflare">;
|
|
141
247
|
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
@@ -147,6 +253,26 @@ export declare const embedOutput: import("typebox").TObject<{
|
|
|
147
253
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
148
254
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
149
255
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
256
|
+
}>, import("typebox").TObject<{
|
|
257
|
+
provider: import("typebox").TLiteral<"opencode">;
|
|
258
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"text-embedding-3-large">, import("typebox").TLiteral<"gemini-embedding-2">, import("typebox").TLiteral<"gemini-embedding-001">, import("typebox").TLiteral<"codestral-embed">, import("typebox").TLiteral<"mistral-embed">, import("typebox").TLiteral<"cohere-embed-v5-pro">, import("typebox").TLiteral<"cohere-embed-v5-fast">, import("typebox").TLiteral<"voyage-4">, import("typebox").TLiteral<"voyage-code-4">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"bge-m3">]>;
|
|
259
|
+
runtime: import("typebox").TLiteral<"opencode-console-embeddings-v1">;
|
|
260
|
+
revision: import("typebox").TNull;
|
|
261
|
+
quantization: import("typebox").TNull;
|
|
262
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
263
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
264
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
265
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
266
|
+
}>, import("typebox").TObject<{
|
|
267
|
+
provider: import("typebox").TLiteral<"opencode-go">;
|
|
268
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"gemini-embedding-2">]>;
|
|
269
|
+
runtime: import("typebox").TLiteral<"opencode-go-embeddings-v1">;
|
|
270
|
+
revision: import("typebox").TNull;
|
|
271
|
+
quantization: import("typebox").TNull;
|
|
272
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
273
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
274
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
275
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
150
276
|
}>]>;
|
|
151
277
|
attemptId: import("typebox").TString;
|
|
152
278
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
@@ -158,7 +284,7 @@ export declare const embedOutput: import("typebox").TObject<{
|
|
|
158
284
|
}>]>>;
|
|
159
285
|
attempts: import("typebox").TArray<import("typebox").TObject<{
|
|
160
286
|
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">]>;
|
|
287
|
+
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">, import("typebox").TLiteral<"gemini">, import("typebox").TLiteral<"vertex">, import("typebox").TLiteral<"opencode">, import("typebox").TLiteral<"opencode-go">]>;
|
|
162
288
|
model: import("typebox").TString;
|
|
163
289
|
routeIndex: import("typebox").TInteger;
|
|
164
290
|
status: import("typebox").TUnion<[import("typebox").TLiteral<"success">, import("typebox").TLiteral<"error">, import("typebox").TLiteral<"cancelled">]>;
|
|
@@ -173,12 +299,12 @@ export declare const embedOutput: import("typebox").TObject<{
|
|
|
173
299
|
export declare const embedCompareOutput: import("typebox").TObject<{
|
|
174
300
|
schemaVersion: import("typebox").TLiteral<2>;
|
|
175
301
|
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">]>;
|
|
302
|
+
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">, import("typebox").TLiteral<"gemini">, import("typebox").TLiteral<"vertex">, import("typebox").TLiteral<"opencode">, import("typebox").TLiteral<"opencode-go">]>;
|
|
177
303
|
model: import("typebox").TString;
|
|
178
304
|
status: import("typebox").TUnion<[import("typebox").TLiteral<"success">, import("typebox").TLiteral<"error">, import("typebox").TLiteral<"cancelled">]>;
|
|
179
305
|
result: import("typebox").TObject<{
|
|
180
306
|
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]>;
|
|
307
|
+
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").TLiteral<"gemini">, import("typebox").TLiteral<"vertex">, import("typebox").TLiteral<"opencode">, import("typebox").TLiteral<"opencode-go">]>, import("typebox").TNull]>;
|
|
182
308
|
model: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
183
309
|
space: import("typebox").TUnion<[import("typebox").TUnion<[import("typebox").TObject<{
|
|
184
310
|
provider: import("typebox").TLiteral<"local">;
|
|
@@ -210,6 +336,28 @@ export declare const embedCompareOutput: import("typebox").TObject<{
|
|
|
210
336
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
211
337
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
212
338
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
339
|
+
}>, import("typebox").TObject<{
|
|
340
|
+
provider: import("typebox").TLiteral<"gemini">;
|
|
341
|
+
runtime: import("typebox").TLiteral<"gemini-api-v1beta">;
|
|
342
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
343
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
344
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
345
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
346
|
+
revision: import("typebox").TNull;
|
|
347
|
+
quantization: import("typebox").TNull;
|
|
348
|
+
dimensions: import("typebox").TInteger;
|
|
349
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
350
|
+
}>, import("typebox").TObject<{
|
|
351
|
+
provider: import("typebox").TLiteral<"vertex">;
|
|
352
|
+
runtime: import("typebox").TLiteral<"vertex-ai-v1">;
|
|
353
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
354
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
355
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
356
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
357
|
+
revision: import("typebox").TNull;
|
|
358
|
+
quantization: import("typebox").TNull;
|
|
359
|
+
dimensions: import("typebox").TInteger;
|
|
360
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
213
361
|
}>, import("typebox").TObject<{
|
|
214
362
|
provider: import("typebox").TLiteral<"cloudflare">;
|
|
215
363
|
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
@@ -221,9 +369,29 @@ export declare const embedCompareOutput: import("typebox").TObject<{
|
|
|
221
369
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
222
370
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
223
371
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
372
|
+
}>, import("typebox").TObject<{
|
|
373
|
+
provider: import("typebox").TLiteral<"opencode">;
|
|
374
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"text-embedding-3-large">, import("typebox").TLiteral<"gemini-embedding-2">, import("typebox").TLiteral<"gemini-embedding-001">, import("typebox").TLiteral<"codestral-embed">, import("typebox").TLiteral<"mistral-embed">, import("typebox").TLiteral<"cohere-embed-v5-pro">, import("typebox").TLiteral<"cohere-embed-v5-fast">, import("typebox").TLiteral<"voyage-4">, import("typebox").TLiteral<"voyage-code-4">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"bge-m3">]>;
|
|
375
|
+
runtime: import("typebox").TLiteral<"opencode-console-embeddings-v1">;
|
|
376
|
+
revision: import("typebox").TNull;
|
|
377
|
+
quantization: import("typebox").TNull;
|
|
378
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
379
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
380
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
381
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
382
|
+
}>, import("typebox").TObject<{
|
|
383
|
+
provider: import("typebox").TLiteral<"opencode-go">;
|
|
384
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"gemini-embedding-2">]>;
|
|
385
|
+
runtime: import("typebox").TLiteral<"opencode-go-embeddings-v1">;
|
|
386
|
+
revision: import("typebox").TNull;
|
|
387
|
+
quantization: import("typebox").TNull;
|
|
388
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
389
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
390
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
391
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
224
392
|
}>]>, import("typebox").TNull]>;
|
|
225
393
|
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">]>;
|
|
394
|
+
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">, import("typebox").TLiteral<"gemini">, import("typebox").TLiteral<"vertex">, import("typebox").TLiteral<"opencode">, import("typebox").TLiteral<"opencode-go">]>;
|
|
227
395
|
model: import("typebox").TString;
|
|
228
396
|
space: import("typebox").TUnion<[import("typebox").TObject<{
|
|
229
397
|
provider: import("typebox").TLiteral<"local">;
|
|
@@ -255,6 +423,28 @@ export declare const embedCompareOutput: import("typebox").TObject<{
|
|
|
255
423
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
256
424
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
257
425
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
426
|
+
}>, import("typebox").TObject<{
|
|
427
|
+
provider: import("typebox").TLiteral<"gemini">;
|
|
428
|
+
runtime: import("typebox").TLiteral<"gemini-api-v1beta">;
|
|
429
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
430
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
431
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
432
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
433
|
+
revision: import("typebox").TNull;
|
|
434
|
+
quantization: import("typebox").TNull;
|
|
435
|
+
dimensions: import("typebox").TInteger;
|
|
436
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
437
|
+
}>, import("typebox").TObject<{
|
|
438
|
+
provider: import("typebox").TLiteral<"vertex">;
|
|
439
|
+
runtime: import("typebox").TLiteral<"vertex-ai-v1">;
|
|
440
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
441
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
442
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
443
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
444
|
+
revision: import("typebox").TNull;
|
|
445
|
+
quantization: import("typebox").TNull;
|
|
446
|
+
dimensions: import("typebox").TInteger;
|
|
447
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
258
448
|
}>, import("typebox").TObject<{
|
|
259
449
|
provider: import("typebox").TLiteral<"cloudflare">;
|
|
260
450
|
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
@@ -266,13 +456,33 @@ export declare const embedCompareOutput: import("typebox").TObject<{
|
|
|
266
456
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
267
457
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
268
458
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
459
|
+
}>, import("typebox").TObject<{
|
|
460
|
+
provider: import("typebox").TLiteral<"opencode">;
|
|
461
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"text-embedding-3-large">, import("typebox").TLiteral<"gemini-embedding-2">, import("typebox").TLiteral<"gemini-embedding-001">, import("typebox").TLiteral<"codestral-embed">, import("typebox").TLiteral<"mistral-embed">, import("typebox").TLiteral<"cohere-embed-v5-pro">, import("typebox").TLiteral<"cohere-embed-v5-fast">, import("typebox").TLiteral<"voyage-4">, import("typebox").TLiteral<"voyage-code-4">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"bge-m3">]>;
|
|
462
|
+
runtime: import("typebox").TLiteral<"opencode-console-embeddings-v1">;
|
|
463
|
+
revision: import("typebox").TNull;
|
|
464
|
+
quantization: import("typebox").TNull;
|
|
465
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
466
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
467
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
468
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
469
|
+
}>, import("typebox").TObject<{
|
|
470
|
+
provider: import("typebox").TLiteral<"opencode-go">;
|
|
471
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"gemini-embedding-2">]>;
|
|
472
|
+
runtime: import("typebox").TLiteral<"opencode-go-embeddings-v1">;
|
|
473
|
+
revision: import("typebox").TNull;
|
|
474
|
+
quantization: import("typebox").TNull;
|
|
475
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
476
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
477
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
478
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
269
479
|
}>]>;
|
|
270
480
|
}>>;
|
|
271
481
|
outcomes: import("typebox").TArray<import("typebox").TUnion<[import("typebox").TObject<{
|
|
272
482
|
status: import("typebox").TLiteral<"success">;
|
|
273
483
|
index: import("typebox").TInteger;
|
|
274
484
|
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">]>;
|
|
485
|
+
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">, import("typebox").TLiteral<"gemini">, import("typebox").TLiteral<"vertex">, import("typebox").TLiteral<"opencode">, import("typebox").TLiteral<"opencode-go">]>;
|
|
276
486
|
model: import("typebox").TString;
|
|
277
487
|
space: import("typebox").TUnion<[import("typebox").TObject<{
|
|
278
488
|
provider: import("typebox").TLiteral<"local">;
|
|
@@ -304,6 +514,28 @@ export declare const embedCompareOutput: import("typebox").TObject<{
|
|
|
304
514
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
305
515
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
306
516
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
517
|
+
}>, import("typebox").TObject<{
|
|
518
|
+
provider: import("typebox").TLiteral<"gemini">;
|
|
519
|
+
runtime: import("typebox").TLiteral<"gemini-api-v1beta">;
|
|
520
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
521
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
522
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
523
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
524
|
+
revision: import("typebox").TNull;
|
|
525
|
+
quantization: import("typebox").TNull;
|
|
526
|
+
dimensions: import("typebox").TInteger;
|
|
527
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
528
|
+
}>, import("typebox").TObject<{
|
|
529
|
+
provider: import("typebox").TLiteral<"vertex">;
|
|
530
|
+
runtime: import("typebox").TLiteral<"vertex-ai-v1">;
|
|
531
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
532
|
+
prefix: import("typebox").TUnion<[import("typebox").TLiteral<"title: none | text: ">, import("typebox").TLiteral<"task: search result | query: ">, import("typebox").TLiteral<"task: question answering | query: ">, import("typebox").TLiteral<"task: fact checking | query: ">, import("typebox").TLiteral<"task: code retrieval | query: ">, import("typebox").TLiteral<"task: classification | query: ">, import("typebox").TLiteral<"task: clustering | query: ">, import("typebox").TLiteral<"task: sentence similarity | query: ">]>;
|
|
533
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
534
|
+
model: import("typebox").TLiteral<"gemini-embedding-2">;
|
|
535
|
+
revision: import("typebox").TNull;
|
|
536
|
+
quantization: import("typebox").TNull;
|
|
537
|
+
dimensions: import("typebox").TInteger;
|
|
538
|
+
taskFormat: import("typebox").TUnion<[import("typebox").TLiteral<"retrieval-document">, import("typebox").TLiteral<"search-query">, import("typebox").TLiteral<"question-answering">, import("typebox").TLiteral<"fact-checking">, import("typebox").TLiteral<"code-retrieval">, import("typebox").TLiteral<"classification">, import("typebox").TLiteral<"clustering">, import("typebox").TLiteral<"sentence-similarity">]>;
|
|
307
539
|
}>, import("typebox").TObject<{
|
|
308
540
|
provider: import("typebox").TLiteral<"cloudflare">;
|
|
309
541
|
model: import("typebox").TLiteral<"@cf/baai/bge-base-en-v1.5">;
|
|
@@ -315,6 +547,26 @@ export declare const embedCompareOutput: import("typebox").TObject<{
|
|
|
315
547
|
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
316
548
|
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
317
549
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
550
|
+
}>, import("typebox").TObject<{
|
|
551
|
+
provider: import("typebox").TLiteral<"opencode">;
|
|
552
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"text-embedding-3-large">, import("typebox").TLiteral<"gemini-embedding-2">, import("typebox").TLiteral<"gemini-embedding-001">, import("typebox").TLiteral<"codestral-embed">, import("typebox").TLiteral<"mistral-embed">, import("typebox").TLiteral<"cohere-embed-v5-pro">, import("typebox").TLiteral<"cohere-embed-v5-fast">, import("typebox").TLiteral<"voyage-4">, import("typebox").TLiteral<"voyage-code-4">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"bge-m3">]>;
|
|
553
|
+
runtime: import("typebox").TLiteral<"opencode-console-embeddings-v1">;
|
|
554
|
+
revision: import("typebox").TNull;
|
|
555
|
+
quantization: import("typebox").TNull;
|
|
556
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
557
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
558
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
559
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
560
|
+
}>, import("typebox").TObject<{
|
|
561
|
+
provider: import("typebox").TLiteral<"opencode-go">;
|
|
562
|
+
model: import("typebox").TUnion<[import("typebox").TLiteral<"text-embedding-3-small">, import("typebox").TLiteral<"qwen3-embedding-8b">, import("typebox").TLiteral<"gemini-embedding-2">]>;
|
|
563
|
+
runtime: import("typebox").TLiteral<"opencode-go-embeddings-v1">;
|
|
564
|
+
revision: import("typebox").TNull;
|
|
565
|
+
quantization: import("typebox").TNull;
|
|
566
|
+
dimensions: import("typebox").TUnion<[import("typebox").TInteger, import("typebox").TNull]>;
|
|
567
|
+
format: import("typebox").TLiteral<"host-display-attributes-v1">;
|
|
568
|
+
prefix: import("typebox").TLiteral<"title: none | text: ">;
|
|
569
|
+
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
318
570
|
}>]>;
|
|
319
571
|
attemptId: import("typebox").TString;
|
|
320
572
|
normalization: import("typebox").TLiteral<"finite-nonzero-l2-v1">;
|
|
@@ -326,7 +578,7 @@ export declare const embedCompareOutput: import("typebox").TObject<{
|
|
|
326
578
|
}>]>>;
|
|
327
579
|
attempts: import("typebox").TArray<import("typebox").TObject<{
|
|
328
580
|
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">]>;
|
|
581
|
+
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">, import("typebox").TLiteral<"gemini">, import("typebox").TLiteral<"vertex">, import("typebox").TLiteral<"opencode">, import("typebox").TLiteral<"opencode-go">]>;
|
|
330
582
|
model: import("typebox").TString;
|
|
331
583
|
routeIndex: import("typebox").TInteger;
|
|
332
584
|
status: import("typebox").TUnion<[import("typebox").TLiteral<"success">, import("typebox").TLiteral<"error">, import("typebox").TLiteral<"cancelled">]>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EmbeddingsProvider, PreparedInput, ProviderBatchResult } from './provider-types.js';
|
|
2
|
+
import { type EmbeddingSettings, type EmbeddingSpace } from './schemas.js';
|
|
3
|
+
type VertexSettings = NonNullable<NonNullable<EmbeddingSettings['providers']>['vertex']>;
|
|
4
|
+
export declare const vertexEmbeddingSpace: (config: VertexSettings) => EmbeddingSpace;
|
|
5
|
+
/** Native Vertex transport: fixed Google hosts, explicit resource, keyless ADC, no gcloud or API keys. */
|
|
6
|
+
export declare class VertexProvider implements EmbeddingsProvider {
|
|
7
|
+
#private;
|
|
8
|
+
readonly route: "vertex";
|
|
9
|
+
readonly model: "gemini-embedding-2";
|
|
10
|
+
readonly space: EmbeddingSpace;
|
|
11
|
+
readonly maxRequestInputs = 1;
|
|
12
|
+
readonly maxRequestTokens: number;
|
|
13
|
+
constructor(config: VertexSettings);
|
|
14
|
+
prepare(text: string, signal: AbortSignal): Promise<PreparedInput>;
|
|
15
|
+
embed(inputs: readonly PreparedInput[], signal: AbortSignal): Promise<ProviderBatchResult>;
|
|
16
|
+
close(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { GdchClient, GoogleAuth, JWT } from 'google-auth-library';
|
|
2
|
+
import { EmbeddingsError } from './errors.js';
|
|
3
|
+
import { headerValueIsSafe, requestJson } from './provider-http.js';
|
|
4
|
+
import { parseGeminiCountTokensResponse, parseVertexEmbeddingResponse } from './response.js';
|
|
5
|
+
import { EMBEDDING_FORMAT_VERSION, EMBEDDING_NORMALIZATION_VERSION, GEMINI_EMBEDDING_MODELS, GEMINI_TASK_PREFIXES, } from './schemas.js';
|
|
6
|
+
// Gemini Embedding 2 shares an 8192-token window across modalities; excess input is silently truncated.
|
|
7
|
+
// https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/embeddings/get-multimodal-embeddings
|
|
8
|
+
const MAX_INPUT_TOKENS = 8192;
|
|
9
|
+
export const vertexEmbeddingSpace = (config) => Object.freeze({
|
|
10
|
+
provider: 'vertex',
|
|
11
|
+
model: GEMINI_EMBEDDING_MODELS[0],
|
|
12
|
+
revision: null,
|
|
13
|
+
quantization: null,
|
|
14
|
+
runtime: 'vertex-ai-v1',
|
|
15
|
+
dimensions: config.dimensions,
|
|
16
|
+
taskFormat: config.taskFormat,
|
|
17
|
+
format: EMBEDDING_FORMAT_VERSION,
|
|
18
|
+
prefix: GEMINI_TASK_PREFIXES[config.taskFormat],
|
|
19
|
+
normalization: EMBEDDING_NORMALIZATION_VERSION,
|
|
20
|
+
});
|
|
21
|
+
/** Inspect only ADC type metadata, including an impersonation source; never expose credentials. */
|
|
22
|
+
const isKeylessCredentialMetadata = (metadata) => {
|
|
23
|
+
if (typeof metadata !== 'object' || metadata === null || !('type' in metadata))
|
|
24
|
+
return false;
|
|
25
|
+
switch (metadata.type) {
|
|
26
|
+
case 'authorized_user':
|
|
27
|
+
case 'external_account':
|
|
28
|
+
case 'external_account_authorized_user':
|
|
29
|
+
return true;
|
|
30
|
+
case 'impersonated_service_account':
|
|
31
|
+
return 'source_credentials' in metadata && isKeylessCredentialMetadata(metadata.source_credentials);
|
|
32
|
+
default:
|
|
33
|
+
// The SDK treats missing/unknown types as JWT credentials too; a denylist misses nested keys.
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
/** Native Vertex transport: fixed Google hosts, explicit resource, keyless ADC, no gcloud or API keys. */
|
|
38
|
+
export class VertexProvider {
|
|
39
|
+
route = 'vertex';
|
|
40
|
+
model = GEMINI_EMBEDDING_MODELS[0];
|
|
41
|
+
space;
|
|
42
|
+
maxRequestInputs = 1; // embedContent contains exactly one Content.
|
|
43
|
+
maxRequestTokens = Number.POSITIVE_INFINITY;
|
|
44
|
+
#config;
|
|
45
|
+
#auth;
|
|
46
|
+
#url;
|
|
47
|
+
#countUrl;
|
|
48
|
+
constructor(config) {
|
|
49
|
+
this.#config = config;
|
|
50
|
+
this.space = vertexEmbeddingSpace(config);
|
|
51
|
+
const origin = config.location === 'global'
|
|
52
|
+
? 'https://aiplatform.googleapis.com'
|
|
53
|
+
: `https://aiplatform.${config.location}.rep.googleapis.com`;
|
|
54
|
+
const resource = `/v1/projects/${encodeURIComponent(config.project)}/locations/${config.location}/publishers/google/models/${this.model}`;
|
|
55
|
+
this.#url = new URL(`${resource}:embedContent`, origin);
|
|
56
|
+
this.#countUrl = new URL(`${resource}:countTokens`, origin);
|
|
57
|
+
// An explicit project also prevents ADC discovery from invoking gcloud to infer one.
|
|
58
|
+
this.#auth = new GoogleAuth({
|
|
59
|
+
projectId: config.project,
|
|
60
|
+
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
async #headers(url, signal) {
|
|
64
|
+
signal.throwIfAborted();
|
|
65
|
+
let listener;
|
|
66
|
+
const cancelled = new Promise((_resolve, reject) => {
|
|
67
|
+
listener = () => reject(new EmbeddingsError('cancelled'));
|
|
68
|
+
signal.addEventListener('abort', listener, { once: true });
|
|
69
|
+
});
|
|
70
|
+
try {
|
|
71
|
+
// The SDK does not expose an AbortSignal for ADC discovery/refresh. Stop waiting on cancellation;
|
|
72
|
+
// any in-flight SDK refresh may finish, but cannot proceed to a model request after cancellation.
|
|
73
|
+
const headers = await Promise.race([(async () => {
|
|
74
|
+
const client = await this.#auth.getClient();
|
|
75
|
+
if (client instanceof JWT || client instanceof GdchClient ||
|
|
76
|
+
(this.#auth.jsonContent !== null && !isKeylessCredentialMetadata(this.#auth.jsonContent)))
|
|
77
|
+
throw new EmbeddingsError('configuration-invalid');
|
|
78
|
+
signal.throwIfAborted();
|
|
79
|
+
return client.getRequestHeaders(url);
|
|
80
|
+
})(), cancelled]);
|
|
81
|
+
signal.throwIfAborted();
|
|
82
|
+
const authorization = headers.get('authorization');
|
|
83
|
+
if (authorization === null || !authorization.startsWith('Bearer ') || !headerValueIsSafe(authorization))
|
|
84
|
+
throw new EmbeddingsError('configuration-invalid');
|
|
85
|
+
const result = { authorization };
|
|
86
|
+
const quotaProject = headers.get('x-goog-user-project');
|
|
87
|
+
if (quotaProject !== null) {
|
|
88
|
+
if (!headerValueIsSafe(quotaProject))
|
|
89
|
+
throw new EmbeddingsError('configuration-invalid');
|
|
90
|
+
result['x-goog-user-project'] = quotaProject;
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
// SDK errors may contain sensitive request metadata. Never propagate them or infer a retry/fallback.
|
|
96
|
+
throw new EmbeddingsError(signal.aborted ? 'cancelled' : 'configuration-invalid');
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
if (listener !== undefined)
|
|
100
|
+
signal.removeEventListener('abort', listener);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async prepare(text, signal) {
|
|
104
|
+
const prepared = GEMINI_TASK_PREFIXES[this.#config.taskFormat] + text;
|
|
105
|
+
const response = await requestJson({
|
|
106
|
+
url: this.#countUrl,
|
|
107
|
+
signal,
|
|
108
|
+
headers: await this.#headers(this.#countUrl, signal),
|
|
109
|
+
body: { contents: [{ role: 'user', parts: [{ text: prepared }] }] },
|
|
110
|
+
});
|
|
111
|
+
const tokenCount = parseGeminiCountTokensResponse(response);
|
|
112
|
+
if (tokenCount > MAX_INPUT_TOKENS)
|
|
113
|
+
throw new EmbeddingsError('input-too-long', { knownUsage: { preparedInputTokens: tokenCount } });
|
|
114
|
+
return { kind: 'text', text: prepared, tokenCount };
|
|
115
|
+
}
|
|
116
|
+
async embed(inputs, signal) {
|
|
117
|
+
const input = inputs[0];
|
|
118
|
+
if (inputs.length !== 1 || input?.kind !== 'text' || input.tokenCount === null)
|
|
119
|
+
throw new EmbeddingsError('provider-response-invalid');
|
|
120
|
+
const response = await requestJson({
|
|
121
|
+
url: this.#url,
|
|
122
|
+
signal,
|
|
123
|
+
headers: await this.#headers(this.#url, signal),
|
|
124
|
+
body: {
|
|
125
|
+
content: { role: 'user', parts: [{ text: input.text }] },
|
|
126
|
+
embedContentConfig: { outputDimensionality: this.space.dimensions },
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
return parseVertexEmbeddingResponse({
|
|
130
|
+
response,
|
|
131
|
+
space: this.space,
|
|
132
|
+
maxInputTokens: MAX_INPUT_TOKENS,
|
|
133
|
+
preparedInputTokens: input.tokenCount,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
async close() {
|
|
137
|
+
// ADC and native fetch own no adapter-created child, timer or listener.
|
|
138
|
+
}
|
|
139
|
+
}
|