@anvia/core 0.26.0 → 1.0.0-rc.2
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 +303 -94
- package/dist/agent/index.d.ts +36 -70
- package/dist/agent/index.js +25 -18
- package/dist/agent-yBG8e9Jj.d.ts +153 -0
- package/dist/chunk-4WI3VGZK.js +127 -0
- package/dist/chunk-4WI3VGZK.js.map +1 -0
- package/dist/chunk-77AIYARB.js +654 -0
- package/dist/chunk-77AIYARB.js.map +1 -0
- package/dist/chunk-AI5JMUW7.js +45 -0
- package/dist/chunk-AI5JMUW7.js.map +1 -0
- package/dist/chunk-BEYBU7VJ.js +53 -0
- package/dist/chunk-BEYBU7VJ.js.map +1 -0
- package/dist/chunk-CWM7B2OO.js +315 -0
- package/dist/chunk-CWM7B2OO.js.map +1 -0
- package/dist/chunk-D37WMSP6.js +131 -0
- package/dist/chunk-D37WMSP6.js.map +1 -0
- package/dist/chunk-DBSCKTUL.js +3793 -0
- package/dist/chunk-DBSCKTUL.js.map +1 -0
- package/dist/chunk-EINTGEGY.js +629 -0
- package/dist/chunk-EINTGEGY.js.map +1 -0
- package/dist/chunk-FMHLROPQ.js +351 -0
- package/dist/chunk-FMHLROPQ.js.map +1 -0
- package/dist/chunk-FN7HLLAZ.js +211 -0
- package/dist/chunk-FN7HLLAZ.js.map +1 -0
- package/dist/chunk-GKDERULJ.js +50 -0
- package/dist/chunk-GKDERULJ.js.map +1 -0
- package/dist/{chunk-CWUJUSOS.js → chunk-KIDGIJM7.js} +26 -5
- package/dist/chunk-KIDGIJM7.js.map +1 -0
- package/dist/chunk-KR3RCCHJ.js +500 -0
- package/dist/chunk-KR3RCCHJ.js.map +1 -0
- package/dist/chunk-MGNTXGTX.js +37 -0
- package/dist/chunk-MGNTXGTX.js.map +1 -0
- package/dist/{chunk-MRQLEK2B.js → chunk-OJH6HWHX.js} +63 -51
- package/dist/chunk-OJH6HWHX.js.map +1 -0
- package/dist/chunk-QOUPWOGW.js +29 -0
- package/dist/chunk-QOUPWOGW.js.map +1 -0
- package/dist/chunk-TIZYTPJO.js +208 -0
- package/dist/chunk-TIZYTPJO.js.map +1 -0
- package/dist/{chunk-NCPN4SJR.js → chunk-XKYYBABH.js} +13 -13
- package/dist/chunk-XKYYBABH.js.map +1 -0
- package/dist/client-B8DT1vUG.d.ts +83 -0
- package/dist/completion/index.d.ts +6 -36
- package/dist/completion/index.js +25 -29
- package/dist/dynamic-tools-KwEGRbHp.d.ts +45 -0
- package/dist/embeddings/index.d.ts +11 -9
- package/dist/embeddings/index.js +2 -4
- package/dist/evals/index.d.ts +47 -20
- package/dist/evals/index.js +104 -65
- package/dist/evals/index.js.map +1 -1
- package/dist/extractor/index.d.ts +27 -42
- package/dist/extractor/index.js +7 -22
- package/dist/guardrails/index.d.ts +3 -2
- package/dist/guardrails/index.js +1 -1
- package/dist/image-generation/index.d.ts +23 -23
- package/dist/image-generation/index.js +5 -39
- package/dist/image-generation/index.js.map +1 -1
- package/dist/index.d.ts +25 -20
- package/dist/index.js +60 -63
- package/dist/internal/agent.d.ts +163 -9
- package/dist/internal/agent.js +25 -18
- package/dist/loaders/index.d.ts +6 -10
- package/dist/loaders/index.js.map +1 -1
- package/dist/mcp/index.d.ts +19 -13
- package/dist/mcp/index.js +13 -348
- package/dist/mcp/index.js.map +1 -1
- package/dist/memory/index.d.ts +20 -6
- package/dist/memory/index.js +9 -10
- package/dist/message-schema-Cn7ezRfJ.d.ts +52 -0
- package/dist/middleware-C7PdmKF7.d.ts +56 -0
- package/dist/model-call-options-CZkSw_xN.d.ts +6 -0
- package/dist/model-listing/index.d.ts +3 -1
- package/dist/observability/index.d.ts +20 -3
- package/dist/observability/index.js +8 -5
- package/dist/observability/index.js.map +1 -1
- package/dist/pipeline/index.d.ts +114 -72
- package/dist/pipeline/index.js +478 -286
- package/dist/pipeline/index.js.map +1 -1
- package/dist/retry-CjvSlKGW.d.ts +16 -0
- package/dist/skills/index.d.ts +5 -4
- package/dist/skills/index.js +7 -8
- package/dist/speech-generation/index.d.ts +37 -0
- package/dist/speech-generation/index.js +8 -0
- package/dist/streaming/index.js +37 -3
- package/dist/streaming/index.js.map +1 -1
- package/dist/{think-tool-DfCMuO8e.d.ts → think-tool-6H2QNQzQ.d.ts} +5 -5
- package/dist/tool/index.d.ts +10 -6
- package/dist/tool/index.js +15 -21
- package/dist/tool--Mz4v1eL.d.ts +57 -0
- package/dist/transcription/index.d.ts +29 -22
- package/dist/transcription/index.js +5 -57
- package/dist/transcription/index.js.map +1 -1
- package/dist/type-utils-CtHVDRn_.d.ts +6 -0
- package/dist/types-3x3mOLHU.d.ts +379 -0
- package/dist/types-BVzM4RsC.d.ts +155 -0
- package/dist/types-CQ_ioXWK.d.ts +319 -0
- package/dist/types-Cr4uiYo5.d.ts +99 -0
- package/dist/{types-04LqWrmy.d.ts → types-DiJqJejp.d.ts} +1 -1
- package/dist/types-Dld1TpWj.d.ts +130 -0
- package/dist/vector-store/index.d.ts +33 -34
- package/dist/vector-store/index.js +6 -6
- package/package.json +6 -18
- package/dist/agent-x3YTyv5i.d.ts +0 -222
- package/dist/audio-generation/index.d.ts +0 -33
- package/dist/audio-generation/index.js +0 -42
- package/dist/audio-generation/index.js.map +0 -1
- package/dist/chunk-2ODTMRHP.js +0 -54
- package/dist/chunk-2ODTMRHP.js.map +0 -1
- package/dist/chunk-ADH7NNCS.js +0 -512
- package/dist/chunk-ADH7NNCS.js.map +0 -1
- package/dist/chunk-BALBBVI3.js +0 -2732
- package/dist/chunk-BALBBVI3.js.map +0 -1
- package/dist/chunk-CWUJUSOS.js.map +0 -1
- package/dist/chunk-DALYP4PX.js +0 -225
- package/dist/chunk-DALYP4PX.js.map +0 -1
- package/dist/chunk-HYUYZEAJ.js +0 -223
- package/dist/chunk-HYUYZEAJ.js.map +0 -1
- package/dist/chunk-I6XOQ4LK.js +0 -466
- package/dist/chunk-I6XOQ4LK.js.map +0 -1
- package/dist/chunk-JI5YZWNT.js +0 -220
- package/dist/chunk-JI5YZWNT.js.map +0 -1
- package/dist/chunk-MC3CCKEB.js +0 -221
- package/dist/chunk-MC3CCKEB.js.map +0 -1
- package/dist/chunk-MELYDKWQ.js +0 -337
- package/dist/chunk-MELYDKWQ.js.map +0 -1
- package/dist/chunk-MNWK2USR.js +0 -243
- package/dist/chunk-MNWK2USR.js.map +0 -1
- package/dist/chunk-MRQLEK2B.js.map +0 -1
- package/dist/chunk-NCPN4SJR.js.map +0 -1
- package/dist/chunk-OIMLU4SF.js +0 -20
- package/dist/chunk-OIMLU4SF.js.map +0 -1
- package/dist/chunk-Q25IWLBT.js +0 -138
- package/dist/chunk-Q25IWLBT.js.map +0 -1
- package/dist/chunk-UQX6EXWG.js +0 -33
- package/dist/chunk-UQX6EXWG.js.map +0 -1
- package/dist/chunk-WQKHFADH.js +0 -12
- package/dist/chunk-WQKHFADH.js.map +0 -1
- package/dist/chunk-XUUY2L2D.js +0 -42
- package/dist/chunk-XUUY2L2D.js.map +0 -1
- package/dist/chunk-XWUC7CIT.js +0 -1
- package/dist/chunk-XWUC7CIT.js.map +0 -1
- package/dist/chunk-YLMDBQO4.js +0 -141
- package/dist/chunk-YLMDBQO4.js.map +0 -1
- package/dist/errors-2moLDuuN.d.ts +0 -17
- package/dist/hooks/index.d.ts +0 -12
- package/dist/hooks/index.js +0 -17
- package/dist/index-BxSbmOMr.d.ts +0 -257
- package/dist/json-BVPssigK.d.ts +0 -39
- package/dist/middleware-Dp3d_pxi.d.ts +0 -90
- package/dist/request/index.d.ts +0 -28
- package/dist/request/index.js +0 -25
- package/dist/request/index.js.map +0 -1
- package/dist/tool-Cohdv5GC.d.ts +0 -65
- package/dist/types-BCTRUGex.d.ts +0 -47
- package/dist/types-BrLbKnEz.d.ts +0 -119
- package/dist/types-D9JpeAPF.d.ts +0 -114
- package/dist/types-G12i56s2.d.ts +0 -354
- package/dist/types-JJCxRnaZ.d.ts +0 -70
- package/dist/types-O-abTIin.d.ts +0 -79
- package/dist/ui/index.d.ts +0 -107
- package/dist/ui/index.js +0 -10
- package/dist/ui/index.js.map +0 -1
- /package/dist/{hooks → speech-generation}/index.js.map +0 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { M as ModelCallOptions } from './model-call-options-CZkSw_xN.js';
|
|
2
|
+
|
|
3
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
4
|
+
type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
5
|
+
type JsonObject = {
|
|
6
|
+
[key: string]: JsonValue | undefined;
|
|
7
|
+
};
|
|
8
|
+
type Document = {
|
|
9
|
+
id: string;
|
|
10
|
+
text: string;
|
|
11
|
+
additionalProps?: Record<string, string>;
|
|
12
|
+
};
|
|
13
|
+
type TextPart = Readonly<{
|
|
14
|
+
type: "text";
|
|
15
|
+
text: string;
|
|
16
|
+
signature?: string;
|
|
17
|
+
}>;
|
|
18
|
+
type ImageDetail = "auto" | "low" | "high";
|
|
19
|
+
type FileData = Readonly<{
|
|
20
|
+
type: "url";
|
|
21
|
+
url: string;
|
|
22
|
+
}> | Readonly<{
|
|
23
|
+
type: "data";
|
|
24
|
+
data: string;
|
|
25
|
+
}> | Readonly<{
|
|
26
|
+
type: "text";
|
|
27
|
+
text: string;
|
|
28
|
+
}>;
|
|
29
|
+
type ImagePart = Readonly<{
|
|
30
|
+
type: "image";
|
|
31
|
+
image: Exclude<FileData, Readonly<{
|
|
32
|
+
type: "text";
|
|
33
|
+
text: string;
|
|
34
|
+
}>>;
|
|
35
|
+
mediaType?: string;
|
|
36
|
+
detail?: ImageDetail;
|
|
37
|
+
}>;
|
|
38
|
+
type FilePart = Readonly<{
|
|
39
|
+
type: "file";
|
|
40
|
+
data: FileData;
|
|
41
|
+
mediaType: string;
|
|
42
|
+
filename?: string;
|
|
43
|
+
}>;
|
|
44
|
+
type ReasoningPart = Readonly<{
|
|
45
|
+
type: "reasoning";
|
|
46
|
+
text: string;
|
|
47
|
+
id?: string;
|
|
48
|
+
details?: readonly ReasoningDetail[];
|
|
49
|
+
}>;
|
|
50
|
+
type ReasoningDetail = Readonly<{
|
|
51
|
+
type: "text";
|
|
52
|
+
text: string;
|
|
53
|
+
signature?: string;
|
|
54
|
+
}> | Readonly<{
|
|
55
|
+
type: "summary";
|
|
56
|
+
text: string;
|
|
57
|
+
}> | Readonly<{
|
|
58
|
+
type: "encrypted";
|
|
59
|
+
data: string;
|
|
60
|
+
}> | Readonly<{
|
|
61
|
+
type: "redacted";
|
|
62
|
+
data: string;
|
|
63
|
+
}>;
|
|
64
|
+
type ReasoningContentType = ReasoningDetail["type"];
|
|
65
|
+
type ToolCallPart = Readonly<{
|
|
66
|
+
type: "tool-call";
|
|
67
|
+
toolCallId: string;
|
|
68
|
+
callId?: string;
|
|
69
|
+
toolName: string;
|
|
70
|
+
input: JsonValue;
|
|
71
|
+
signature?: string;
|
|
72
|
+
}>;
|
|
73
|
+
type ToolResultContentPart = TextPart | FilePart;
|
|
74
|
+
type ToolResultOutput = Readonly<{
|
|
75
|
+
type: "text";
|
|
76
|
+
value: string;
|
|
77
|
+
}> | Readonly<{
|
|
78
|
+
type: "json";
|
|
79
|
+
value: JsonValue;
|
|
80
|
+
}> | Readonly<{
|
|
81
|
+
type: "content";
|
|
82
|
+
value: readonly ToolResultContentPart[];
|
|
83
|
+
}> | Readonly<{
|
|
84
|
+
type: "execution-denied";
|
|
85
|
+
reason?: string;
|
|
86
|
+
}> | Readonly<{
|
|
87
|
+
type: "error-text";
|
|
88
|
+
value: string;
|
|
89
|
+
}> | Readonly<{
|
|
90
|
+
type: "error-json";
|
|
91
|
+
value: JsonValue;
|
|
92
|
+
}>;
|
|
93
|
+
type ToolResultPart = Readonly<{
|
|
94
|
+
type: "tool-result";
|
|
95
|
+
toolCallId: string;
|
|
96
|
+
callId?: string;
|
|
97
|
+
toolName: string;
|
|
98
|
+
output: ToolResultOutput;
|
|
99
|
+
}>;
|
|
100
|
+
type UserContentPart = TextPart | ImagePart | FilePart;
|
|
101
|
+
type AssistantContentPart = TextPart | ImagePart | FilePart | ReasoningPart | ToolCallPart;
|
|
102
|
+
type SystemMessage<Metadata extends JsonObject = JsonObject> = Readonly<{
|
|
103
|
+
role: "system";
|
|
104
|
+
content: string;
|
|
105
|
+
metadata?: Metadata;
|
|
106
|
+
}>;
|
|
107
|
+
type UserMessage<Metadata extends JsonObject = JsonObject> = Readonly<{
|
|
108
|
+
role: "user";
|
|
109
|
+
content: string | readonly UserContentPart[];
|
|
110
|
+
metadata?: Metadata;
|
|
111
|
+
}>;
|
|
112
|
+
type AssistantMessage<Metadata extends JsonObject = JsonObject> = Readonly<{
|
|
113
|
+
role: "assistant";
|
|
114
|
+
id?: string;
|
|
115
|
+
content: string | readonly AssistantContentPart[];
|
|
116
|
+
metadata?: Metadata;
|
|
117
|
+
}>;
|
|
118
|
+
type ToolMessage<Metadata extends JsonObject = JsonObject> = Readonly<{
|
|
119
|
+
role: "tool";
|
|
120
|
+
content: readonly ToolResultPart[];
|
|
121
|
+
metadata?: Metadata;
|
|
122
|
+
}>;
|
|
123
|
+
type Message<Metadata extends JsonObject = JsonObject> = SystemMessage<Metadata> | UserMessage<Metadata> | AssistantMessage<Metadata> | ToolMessage<Metadata>;
|
|
124
|
+
declare function reasoningDisplayText(reasoning: ReasoningPart | readonly ReasoningDetail[]): string;
|
|
125
|
+
type ToolChoice = "auto" | "required" | "none" | {
|
|
126
|
+
type: "function";
|
|
127
|
+
name: string;
|
|
128
|
+
};
|
|
129
|
+
type ToolDefinition = {
|
|
130
|
+
name: string;
|
|
131
|
+
description: string;
|
|
132
|
+
parameters: JsonObject;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* A tool executed by the model provider rather than by Anvia's local tool runtime.
|
|
136
|
+
*
|
|
137
|
+
* Provider packages expose typed factories for these values. Application code can
|
|
138
|
+
* pass them through the same high-level `tools` APIs used for local tools.
|
|
139
|
+
*/
|
|
140
|
+
type ProviderTool = {
|
|
141
|
+
kind: "provider";
|
|
142
|
+
provider: string;
|
|
143
|
+
name: string;
|
|
144
|
+
configuration?: JsonObject;
|
|
145
|
+
};
|
|
146
|
+
type CompletionTool = ToolDefinition | ProviderTool;
|
|
147
|
+
declare function isProviderTool(value: unknown): value is ProviderTool;
|
|
148
|
+
type CompletionSource = {
|
|
149
|
+
type: "url";
|
|
150
|
+
url: string;
|
|
151
|
+
title?: string;
|
|
152
|
+
id?: string;
|
|
153
|
+
startIndex?: number;
|
|
154
|
+
endIndex?: number;
|
|
155
|
+
};
|
|
156
|
+
type ProviderToolCall = {
|
|
157
|
+
id: string;
|
|
158
|
+
name: string;
|
|
159
|
+
status?: string;
|
|
160
|
+
details?: JsonObject;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Provider-normalized, mutually exclusive usage buckets.
|
|
164
|
+
*
|
|
165
|
+
* Every token should appear in exactly one non-total bucket. `total` is the
|
|
166
|
+
* only aggregate key and should equal the sum of the other buckets.
|
|
167
|
+
*/
|
|
168
|
+
type UsageDetails = Record<string, number>;
|
|
169
|
+
type ModelContextLimits = {
|
|
170
|
+
contextWindow: number;
|
|
171
|
+
maxInputTokens?: number;
|
|
172
|
+
maxOutputTokens?: number;
|
|
173
|
+
};
|
|
174
|
+
type CompletionModelInfo = {
|
|
175
|
+
modelId: string;
|
|
176
|
+
context: ModelContextLimits;
|
|
177
|
+
};
|
|
178
|
+
type ContextUsage = {
|
|
179
|
+
model: CompletionModelInfo;
|
|
180
|
+
usedTokens: number;
|
|
181
|
+
remainingTokens: number;
|
|
182
|
+
usedPercent: number;
|
|
183
|
+
remainingPercent: number;
|
|
184
|
+
};
|
|
185
|
+
declare function calculateContextUsage(usage: Usage, model: CompletionModelInfo | undefined): ContextUsage | undefined;
|
|
186
|
+
declare function withContextUsage<RawResponse>(response: CompletionResponse<RawResponse>, model: CompletionModelInfo | undefined): CompletionResponse<RawResponse>;
|
|
187
|
+
declare function resolveModelContextLimits(modelId: string, catalog: Readonly<Record<string, ModelContextLimits>>, override?: ModelContextLimits): ModelContextLimits | undefined;
|
|
188
|
+
type AssistantGenerationMetadata = {
|
|
189
|
+
provider: string;
|
|
190
|
+
modelId: string;
|
|
191
|
+
usage: Usage;
|
|
192
|
+
contextUsage?: ContextUsage;
|
|
193
|
+
sources?: CompletionSource[];
|
|
194
|
+
providerToolCalls?: ProviderToolCall[];
|
|
195
|
+
};
|
|
196
|
+
type Usage = {
|
|
197
|
+
inputTokens: number;
|
|
198
|
+
outputTokens: number;
|
|
199
|
+
totalTokens: number;
|
|
200
|
+
cachedInputTokens: number;
|
|
201
|
+
cacheCreationInputTokens: number;
|
|
202
|
+
details?: UsageDetails;
|
|
203
|
+
};
|
|
204
|
+
declare const Usage: {
|
|
205
|
+
empty(): Usage;
|
|
206
|
+
add(left: Usage, right: Usage): Usage;
|
|
207
|
+
};
|
|
208
|
+
declare function getAssistantGenerationMetadata(message: Message): AssistantGenerationMetadata | undefined;
|
|
209
|
+
type CompletionRequest = {
|
|
210
|
+
instructions?: string;
|
|
211
|
+
chatHistory: Message[];
|
|
212
|
+
documents: Document[];
|
|
213
|
+
tools: ToolDefinition[];
|
|
214
|
+
providerTools?: ProviderTool[];
|
|
215
|
+
temperature?: number;
|
|
216
|
+
maxTokens?: number;
|
|
217
|
+
toolChoice?: ToolChoice;
|
|
218
|
+
providerOptions?: JsonObject;
|
|
219
|
+
outputSchema?: JsonObject;
|
|
220
|
+
};
|
|
221
|
+
type CompletionResponse<RawResponse = unknown> = {
|
|
222
|
+
choice: AssistantContentPart[];
|
|
223
|
+
usage: Usage;
|
|
224
|
+
contextUsage?: ContextUsage;
|
|
225
|
+
rawResponse: RawResponse;
|
|
226
|
+
messageId?: string;
|
|
227
|
+
sources?: CompletionSource[];
|
|
228
|
+
providerToolCalls?: ProviderToolCall[];
|
|
229
|
+
};
|
|
230
|
+
type CompletionResult<Output = string, RawResponse = unknown> = {
|
|
231
|
+
output: Output;
|
|
232
|
+
text: string;
|
|
233
|
+
content: readonly AssistantContentPart[];
|
|
234
|
+
usage: Usage;
|
|
235
|
+
contextUsage?: ContextUsage;
|
|
236
|
+
rawResponse: RawResponse;
|
|
237
|
+
messageId?: string;
|
|
238
|
+
sources?: readonly CompletionSource[];
|
|
239
|
+
providerToolCalls?: readonly ProviderToolCall[];
|
|
240
|
+
};
|
|
241
|
+
type CompletionModelCapabilities = {
|
|
242
|
+
streaming: boolean;
|
|
243
|
+
tools: boolean;
|
|
244
|
+
toolChoice: boolean;
|
|
245
|
+
imageInput: boolean;
|
|
246
|
+
documentInput: boolean;
|
|
247
|
+
outputSchema: boolean;
|
|
248
|
+
reasoning: boolean;
|
|
249
|
+
providerTools?: boolean;
|
|
250
|
+
};
|
|
251
|
+
interface CompletionModel<RawResponse = unknown> {
|
|
252
|
+
readonly provider: string;
|
|
253
|
+
readonly modelId: string;
|
|
254
|
+
readonly contextLimits?: ModelContextLimits | undefined;
|
|
255
|
+
readonly capabilities: CompletionModelCapabilities;
|
|
256
|
+
traceRequest?(request: CompletionRequest, options?: {
|
|
257
|
+
stream?: boolean | undefined;
|
|
258
|
+
}): JsonObject | undefined;
|
|
259
|
+
completion(request: CompletionRequest, options?: ModelCallOptions): Promise<CompletionResponse<RawResponse>>;
|
|
260
|
+
}
|
|
261
|
+
type ToolCallArgumentsMode = "append" | "replace";
|
|
262
|
+
type CompletionStreamPart = {
|
|
263
|
+
type: "text_delta";
|
|
264
|
+
delta: string;
|
|
265
|
+
} | {
|
|
266
|
+
type: "reasoning_delta";
|
|
267
|
+
delta: string;
|
|
268
|
+
id?: string;
|
|
269
|
+
contentType?: ReasoningContentType;
|
|
270
|
+
signature?: string;
|
|
271
|
+
} | {
|
|
272
|
+
type: "tool_call_delta";
|
|
273
|
+
id: string;
|
|
274
|
+
callId?: string;
|
|
275
|
+
name?: string;
|
|
276
|
+
argumentsDelta?: string;
|
|
277
|
+
argumentsMode?: ToolCallArgumentsMode;
|
|
278
|
+
signature?: string;
|
|
279
|
+
} | {
|
|
280
|
+
type: "tool_call";
|
|
281
|
+
toolCall: ToolCallPart;
|
|
282
|
+
} | {
|
|
283
|
+
type: "source";
|
|
284
|
+
source: CompletionSource;
|
|
285
|
+
} | {
|
|
286
|
+
type: "provider_tool_call";
|
|
287
|
+
toolCall: ProviderToolCall;
|
|
288
|
+
} | {
|
|
289
|
+
type: "message_id";
|
|
290
|
+
id: string;
|
|
291
|
+
};
|
|
292
|
+
type CompletionModelStreamEvent<RawResponse = unknown> = CompletionStreamPart | {
|
|
293
|
+
type: "final";
|
|
294
|
+
response: CompletionResponse<RawResponse>;
|
|
295
|
+
} | {
|
|
296
|
+
type: "error";
|
|
297
|
+
error: unknown;
|
|
298
|
+
usage?: Usage;
|
|
299
|
+
};
|
|
300
|
+
type CompletionStreamEvent<Output = string, RawResponse = unknown> = CompletionStreamPart | {
|
|
301
|
+
type: "final";
|
|
302
|
+
result: CompletionResult<Output, RawResponse>;
|
|
303
|
+
} | {
|
|
304
|
+
type: "error";
|
|
305
|
+
error: unknown;
|
|
306
|
+
usage: Usage;
|
|
307
|
+
};
|
|
308
|
+
interface StreamingCompletionModel<RawResponse = unknown> extends CompletionModel<RawResponse> {
|
|
309
|
+
streamCompletion(request: CompletionRequest, options?: ModelCallOptions): AsyncIterable<CompletionModelStreamEvent<RawResponse>>;
|
|
310
|
+
}
|
|
311
|
+
declare class CompletionCapabilityError extends Error {
|
|
312
|
+
constructor(message: string);
|
|
313
|
+
}
|
|
314
|
+
declare function assertCompletionRequestSupported(model: CompletionModel, request: CompletionRequest, options?: {
|
|
315
|
+
streaming?: boolean | undefined;
|
|
316
|
+
}): void;
|
|
317
|
+
declare function textFromAssistantContent(content: readonly AssistantContentPart[]): string;
|
|
318
|
+
|
|
319
|
+
export { textFromAssistantContent as $, type AssistantContentPart as A, type UserContentPart as B, type CompletionModel as C, type Document as D, type UserMessage as E, type FileData as F, calculateContextUsage as G, getAssistantGenerationMetadata as H, type ImageDetail as I, type JsonObject as J, isProviderTool as K, resolveModelContextLimits as L, type Message as M, withContextUsage as N, CompletionCapabilityError as O, type ProviderTool as P, type CompletionModelCapabilities as Q, type ReasoningContentType as R, type SystemMessage as S, type TextPart as T, Usage as U, type CompletionStreamPart as V, type StreamingCompletionModel as W, type ToolCallArgumentsMode as X, type UsageDetails as Y, assertCompletionRequestSupported as Z, reasoningDisplayText as _, type AssistantGenerationMetadata as a, type AssistantMessage as b, type CompletionModelInfo as c, type CompletionModelStreamEvent as d, type CompletionRequest as e, type CompletionResponse as f, type CompletionResult as g, type CompletionSource as h, type CompletionStreamEvent as i, type CompletionTool as j, type ContextUsage as k, type FilePart as l, type ImagePart as m, type JsonPrimitive as n, type JsonValue as o, type ModelContextLimits as p, type ProviderToolCall as q, type ReasoningDetail as r, type ReasoningPart as s, type ToolCallPart as t, type ToolChoice as u, type ToolDefinition as v, type ToolMessage as w, type ToolResultContentPart as x, type ToolResultOutput as y, type ToolResultPart as z };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { M as ModelCallOptions } from './model-call-options-CZkSw_xN.js';
|
|
2
|
+
import { b as RetrySetting } from './retry-CjvSlKGW.js';
|
|
3
|
+
|
|
4
|
+
type Embedding = {
|
|
5
|
+
document: string;
|
|
6
|
+
vector: number[];
|
|
7
|
+
};
|
|
8
|
+
type SparseVector = {
|
|
9
|
+
indices: number[];
|
|
10
|
+
values: number[];
|
|
11
|
+
};
|
|
12
|
+
type SparseEmbedding = {
|
|
13
|
+
document: string;
|
|
14
|
+
vector: SparseVector;
|
|
15
|
+
};
|
|
16
|
+
interface EmbeddingModel {
|
|
17
|
+
readonly provider: string;
|
|
18
|
+
readonly modelId: string;
|
|
19
|
+
readonly dimensions?: number | undefined;
|
|
20
|
+
readonly maxBatchSize?: number | undefined;
|
|
21
|
+
embedTexts(texts: string[], options?: ModelCallOptions | undefined): Promise<Embedding[]>;
|
|
22
|
+
}
|
|
23
|
+
/** Sparse lexical/neural encoder used for hybrid retrieval channels. */
|
|
24
|
+
interface SparseEmbeddingModel {
|
|
25
|
+
readonly provider: string;
|
|
26
|
+
readonly modelId: string;
|
|
27
|
+
readonly maxBatchSize?: number | undefined;
|
|
28
|
+
/** Embed passage/document texts for indexing. */
|
|
29
|
+
embedTexts(texts: string[], options?: ModelCallOptions | undefined): Promise<SparseEmbedding[]>;
|
|
30
|
+
/** Embed a search query (may differ from passage encoding for models like SPLADE). */
|
|
31
|
+
embedQuery(query: string, options?: ModelCallOptions | undefined): Promise<SparseEmbedding>;
|
|
32
|
+
}
|
|
33
|
+
type EmbeddedDocument<T, Metadata extends VectorMetadata = VectorMetadata> = {
|
|
34
|
+
id: string;
|
|
35
|
+
document: T;
|
|
36
|
+
metadata?: Metadata | undefined;
|
|
37
|
+
embeddings: Embedding[];
|
|
38
|
+
/** Optional sparse vectors aligned 1:1 with `embeddings` by chunk index. */
|
|
39
|
+
sparseEmbeddings?: SparseEmbedding[] | undefined;
|
|
40
|
+
};
|
|
41
|
+
type VectorMetadataValue = string | number | boolean | null;
|
|
42
|
+
type VectorMetadata = Record<string, VectorMetadataValue>;
|
|
43
|
+
type EmbeddingOperationOptions = {
|
|
44
|
+
retries?: RetrySetting | undefined;
|
|
45
|
+
abortSignal?: AbortSignal | undefined;
|
|
46
|
+
};
|
|
47
|
+
type EmbedTextOptions = EmbeddingOperationOptions & {
|
|
48
|
+
model: EmbeddingModel;
|
|
49
|
+
text: string;
|
|
50
|
+
};
|
|
51
|
+
type EmbedTextsOptions = EmbeddingOperationOptions & {
|
|
52
|
+
model: EmbeddingModel;
|
|
53
|
+
texts: string[];
|
|
54
|
+
concurrency?: number | undefined;
|
|
55
|
+
};
|
|
56
|
+
type EmbedSparseTextsOptions = EmbeddingOperationOptions & {
|
|
57
|
+
model: SparseEmbeddingModel;
|
|
58
|
+
texts: string[];
|
|
59
|
+
concurrency?: number | undefined;
|
|
60
|
+
};
|
|
61
|
+
type EmbedSparseQueryOptions = EmbeddingOperationOptions & {
|
|
62
|
+
model: SparseEmbeddingModel;
|
|
63
|
+
query: string;
|
|
64
|
+
};
|
|
65
|
+
type EmbedDocumentsBaseOptions<T, Metadata extends VectorMetadata = VectorMetadata> = EmbeddingOperationOptions & {
|
|
66
|
+
documents: T[];
|
|
67
|
+
id?: ((document: T, index: number) => string) | undefined;
|
|
68
|
+
content(document: T, index: number): string | string[];
|
|
69
|
+
metadata?: ((document: T, index: number) => Metadata | undefined) | undefined;
|
|
70
|
+
concurrency?: number | undefined;
|
|
71
|
+
};
|
|
72
|
+
type EmbedDocumentsOptions<T, Metadata extends VectorMetadata = VectorMetadata> = EmbedDocumentsBaseOptions<T, Metadata> & {
|
|
73
|
+
model: EmbeddingModel;
|
|
74
|
+
models?: never;
|
|
75
|
+
};
|
|
76
|
+
type EmbedHybridDocumentsOptions<T, Metadata extends VectorMetadata = VectorMetadata> = EmbedDocumentsBaseOptions<T, Metadata> & {
|
|
77
|
+
model?: never;
|
|
78
|
+
models: {
|
|
79
|
+
dense: EmbeddingModel;
|
|
80
|
+
sparse: SparseEmbeddingModel;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
type EmbedTextResult = {
|
|
84
|
+
embedding: Embedding;
|
|
85
|
+
};
|
|
86
|
+
type EmbedTextsResult = {
|
|
87
|
+
embeddings: Embedding[];
|
|
88
|
+
};
|
|
89
|
+
type EmbedSparseTextsResult = {
|
|
90
|
+
embeddings: SparseEmbedding[];
|
|
91
|
+
};
|
|
92
|
+
type EmbedSparseQueryResult = {
|
|
93
|
+
embedding: SparseEmbedding;
|
|
94
|
+
};
|
|
95
|
+
type EmbedDocumentsResult<T, Metadata extends VectorMetadata = VectorMetadata> = {
|
|
96
|
+
documents: Array<EmbeddedDocument<T, Metadata>>;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export type { EmbeddingModel as E, SparseVector as S, VectorMetadata as V, EmbeddedDocument as a, VectorMetadataValue as b, SparseEmbeddingModel as c, EmbedDocumentsOptions as d, EmbedDocumentsResult as e, EmbedHybridDocumentsOptions as f, EmbedSparseQueryOptions as g, EmbedSparseQueryResult as h, EmbedSparseTextsOptions as i, EmbedSparseTextsResult as j, EmbedTextOptions as k, EmbedTextResult as l, EmbedTextsOptions as m, EmbedTextsResult as n, EmbedDocumentsBaseOptions as o, Embedding as p, EmbeddingOperationOptions as q, SparseEmbedding as r };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { b as RetrySetting } from './retry-CjvSlKGW.js';
|
|
2
|
+
import { J as JsonObject } from './types-CQ_ioXWK.js';
|
|
3
|
+
import { b as VectorMetadataValue, V as VectorMetadata, a as EmbeddedDocument, S as SparseVector, E as EmbeddingModel, c as SparseEmbeddingModel } from './types-Cr4uiYo5.js';
|
|
4
|
+
|
|
5
|
+
type VectorFilter = {
|
|
6
|
+
type: "eq";
|
|
7
|
+
key: string;
|
|
8
|
+
value: VectorMetadataValue;
|
|
9
|
+
} | {
|
|
10
|
+
type: "gt";
|
|
11
|
+
key: string;
|
|
12
|
+
value: VectorMetadataValue;
|
|
13
|
+
} | {
|
|
14
|
+
type: "lt";
|
|
15
|
+
key: string;
|
|
16
|
+
value: VectorMetadataValue;
|
|
17
|
+
} | {
|
|
18
|
+
type: "and";
|
|
19
|
+
filters: [VectorFilter, VectorFilter];
|
|
20
|
+
} | {
|
|
21
|
+
type: "or";
|
|
22
|
+
filters: [VectorFilter, VectorFilter];
|
|
23
|
+
};
|
|
24
|
+
type VectorMetric = "cosine" | "euclidean" | "dotProduct";
|
|
25
|
+
type VectorFusion = "rrf" | "dbsf";
|
|
26
|
+
type LshOptions = {
|
|
27
|
+
type: "lsh";
|
|
28
|
+
numTables: number;
|
|
29
|
+
numHyperplanes: number;
|
|
30
|
+
seed?: number | undefined;
|
|
31
|
+
};
|
|
32
|
+
type IndexStrategy = {
|
|
33
|
+
type: "bruteForce";
|
|
34
|
+
} | LshOptions;
|
|
35
|
+
type VectorStoreUpsertOptions<T, Metadata extends VectorMetadata = VectorMetadata> = {
|
|
36
|
+
documents: Array<EmbeddedDocument<T, Metadata>>;
|
|
37
|
+
providerOptions?: JsonObject | undefined;
|
|
38
|
+
};
|
|
39
|
+
type VectorSearchRequest = {
|
|
40
|
+
vector: number[];
|
|
41
|
+
topK: number;
|
|
42
|
+
minScore?: number | undefined;
|
|
43
|
+
filter?: VectorFilter | undefined;
|
|
44
|
+
providerOptions?: JsonObject | undefined;
|
|
45
|
+
abortSignal?: AbortSignal | undefined;
|
|
46
|
+
};
|
|
47
|
+
type HybridVectorSearchRequest = VectorSearchRequest & {
|
|
48
|
+
sparseVector: SparseVector;
|
|
49
|
+
fusion?: VectorFusion | undefined;
|
|
50
|
+
};
|
|
51
|
+
type VectorSearchResult<T = unknown, Metadata extends VectorMetadata = VectorMetadata> = {
|
|
52
|
+
score: number;
|
|
53
|
+
id: string;
|
|
54
|
+
document: T;
|
|
55
|
+
metadata?: Metadata | undefined;
|
|
56
|
+
};
|
|
57
|
+
type VectorInspectRequest = {
|
|
58
|
+
limit: number;
|
|
59
|
+
cursor?: string | undefined;
|
|
60
|
+
filter?: VectorFilter | undefined;
|
|
61
|
+
providerOptions?: JsonObject | undefined;
|
|
62
|
+
abortSignal?: AbortSignal | undefined;
|
|
63
|
+
};
|
|
64
|
+
type VectorInspectItem<T = unknown, Metadata extends VectorMetadata = VectorMetadata> = {
|
|
65
|
+
id: string;
|
|
66
|
+
document: T;
|
|
67
|
+
metadata?: Metadata | undefined;
|
|
68
|
+
};
|
|
69
|
+
type VectorInspectPage<T = unknown, Metadata extends VectorMetadata = VectorMetadata> = {
|
|
70
|
+
items: Array<VectorInspectItem<T, Metadata>>;
|
|
71
|
+
nextCursor?: string | undefined;
|
|
72
|
+
totalCount?: number | undefined;
|
|
73
|
+
};
|
|
74
|
+
interface VectorStore<T = unknown, Metadata extends VectorMetadata = VectorMetadata> {
|
|
75
|
+
ensure(): Promise<void>;
|
|
76
|
+
validate(): Promise<void>;
|
|
77
|
+
upsert(options: VectorStoreUpsertOptions<T, Metadata>): Promise<void>;
|
|
78
|
+
search(request: VectorSearchRequest): Promise<Array<VectorSearchResult<T, Metadata>>>;
|
|
79
|
+
inspect?(request: VectorInspectRequest): Promise<VectorInspectPage<T, Metadata>>;
|
|
80
|
+
}
|
|
81
|
+
interface HybridVectorStore<T = unknown, Metadata extends VectorMetadata = VectorMetadata> extends VectorStore<T, Metadata> {
|
|
82
|
+
searchHybrid(request: HybridVectorSearchRequest): Promise<Array<VectorSearchResult<T, Metadata>>>;
|
|
83
|
+
}
|
|
84
|
+
type RetrieveDocumentsBaseOptions = {
|
|
85
|
+
query: string;
|
|
86
|
+
topK: number;
|
|
87
|
+
minScore?: number | undefined;
|
|
88
|
+
filter?: VectorFilter | undefined;
|
|
89
|
+
retries?: RetrySetting | undefined;
|
|
90
|
+
abortSignal?: AbortSignal | undefined;
|
|
91
|
+
};
|
|
92
|
+
type RetrieveDocumentsOptions<T, Metadata extends VectorMetadata = VectorMetadata> = RetrieveDocumentsBaseOptions & {
|
|
93
|
+
store: VectorStore<T, Metadata>;
|
|
94
|
+
model: EmbeddingModel;
|
|
95
|
+
models?: never;
|
|
96
|
+
};
|
|
97
|
+
type RetrieveHybridDocumentsOptions<T, Metadata extends VectorMetadata = VectorMetadata> = RetrieveDocumentsBaseOptions & {
|
|
98
|
+
store: HybridVectorStore<T, Metadata>;
|
|
99
|
+
model?: never;
|
|
100
|
+
models: {
|
|
101
|
+
dense: EmbeddingModel;
|
|
102
|
+
sparse: SparseEmbeddingModel;
|
|
103
|
+
};
|
|
104
|
+
fusion?: VectorFusion | undefined;
|
|
105
|
+
};
|
|
106
|
+
type VectorSearchToolBaseOptions = {
|
|
107
|
+
name: string;
|
|
108
|
+
description?: string | undefined;
|
|
109
|
+
topK?: number | undefined;
|
|
110
|
+
minScore?: number | undefined;
|
|
111
|
+
filter?: VectorFilter | undefined;
|
|
112
|
+
retries?: RetrySetting | undefined;
|
|
113
|
+
};
|
|
114
|
+
type DenseVectorSearchToolOptions<T, Metadata extends VectorMetadata = VectorMetadata> = VectorSearchToolBaseOptions & {
|
|
115
|
+
store: VectorStore<T, Metadata>;
|
|
116
|
+
model: EmbeddingModel;
|
|
117
|
+
models?: never;
|
|
118
|
+
};
|
|
119
|
+
type HybridVectorSearchToolOptions<T, Metadata extends VectorMetadata = VectorMetadata> = VectorSearchToolBaseOptions & {
|
|
120
|
+
store: HybridVectorStore<T, Metadata>;
|
|
121
|
+
model?: never;
|
|
122
|
+
models: {
|
|
123
|
+
dense: EmbeddingModel;
|
|
124
|
+
sparse: SparseEmbeddingModel;
|
|
125
|
+
};
|
|
126
|
+
fusion?: VectorFusion | undefined;
|
|
127
|
+
};
|
|
128
|
+
type VectorSearchToolOptions<T = unknown, Metadata extends VectorMetadata = VectorMetadata> = DenseVectorSearchToolOptions<T, Metadata> | HybridVectorSearchToolOptions<T, Metadata>;
|
|
129
|
+
|
|
130
|
+
export type { DenseVectorSearchToolOptions as D, HybridVectorStore as H, IndexStrategy as I, LshOptions as L, RetrieveDocumentsOptions as R, VectorFilter as V, VectorSearchResult as a, VectorInspectRequest as b, VectorInspectPage as c, VectorStore as d, VectorFusion as e, RetrieveHybridDocumentsOptions as f, VectorStoreUpsertOptions as g, VectorSearchRequest as h, VectorSearchToolOptions as i, HybridVectorSearchRequest as j, HybridVectorSearchToolOptions as k, RetrieveDocumentsBaseOptions as l, VectorInspectItem as m, VectorMetric as n, VectorSearchToolBaseOptions as o };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { T as Tool } from '../tool
|
|
3
|
-
import { V as VectorFilter, a as
|
|
4
|
-
export { L as LshOptions,
|
|
5
|
-
import '../
|
|
1
|
+
import { b as VectorMetadataValue, V as VectorMetadata, a as EmbeddedDocument } from '../types-Cr4uiYo5.js';
|
|
2
|
+
import { T as Tool } from '../tool--Mz4v1eL.js';
|
|
3
|
+
import { V as VectorFilter, R as RetrieveDocumentsOptions, a as VectorSearchResult, f as RetrieveHybridDocumentsOptions, d as VectorStore, I as IndexStrategy, g as VectorStoreUpsertOptions, h as VectorSearchRequest, b as VectorInspectRequest, c as VectorInspectPage, i as VectorSearchToolOptions } from '../types-Dld1TpWj.js';
|
|
4
|
+
export { D as DenseVectorSearchToolOptions, j as HybridVectorSearchRequest, k as HybridVectorSearchToolOptions, H as HybridVectorStore, L as LshOptions, l as RetrieveDocumentsBaseOptions, e as VectorFusion, m as VectorInspectItem, n as VectorMetric, o as VectorSearchToolBaseOptions } from '../types-Dld1TpWj.js';
|
|
5
|
+
import '../model-call-options-CZkSw_xN.js';
|
|
6
|
+
import '../retry-CjvSlKGW.js';
|
|
7
|
+
import '../types-CQ_ioXWK.js';
|
|
6
8
|
|
|
7
9
|
declare const vectorFilter: {
|
|
8
10
|
eq(key: string, value: VectorMetadataValue): VectorFilter;
|
|
@@ -12,47 +14,44 @@ declare const vectorFilter: {
|
|
|
12
14
|
or(left: VectorFilter, right: VectorFilter): VectorFilter;
|
|
13
15
|
};
|
|
14
16
|
|
|
17
|
+
declare function retrieveDocuments<T, Metadata extends VectorMetadata = VectorMetadata>(options: RetrieveDocumentsOptions<T, Metadata>): Promise<Array<VectorSearchResult<T, Metadata>>>;
|
|
18
|
+
declare function retrieveDocuments<T, Metadata extends VectorMetadata = VectorMetadata>(options: RetrieveHybridDocumentsOptions<T, Metadata>): Promise<Array<VectorSearchResult<T, Metadata>>>;
|
|
19
|
+
|
|
15
20
|
type StoredDocument<T, Metadata extends VectorMetadata> = EmbeddedDocument<T, Metadata>;
|
|
16
|
-
|
|
21
|
+
type InMemoryVectorStoreOptions = {
|
|
22
|
+
dimensions?: number | undefined;
|
|
23
|
+
index?: IndexStrategy | undefined;
|
|
24
|
+
};
|
|
25
|
+
type InMemoryVectorStoreFromDocumentsOptions<T, Metadata extends VectorMetadata = VectorMetadata> = InMemoryVectorStoreOptions & {
|
|
26
|
+
documents: Array<EmbeddedDocument<T, Metadata>>;
|
|
27
|
+
};
|
|
28
|
+
declare class InMemoryVectorStore<T, Metadata extends VectorMetadata = VectorMetadata> implements VectorStore<T, Metadata> {
|
|
17
29
|
private readonly documents;
|
|
18
|
-
private indexStrategy;
|
|
30
|
+
private readonly indexStrategy;
|
|
19
31
|
private lshIndex;
|
|
20
32
|
private embeddingDimension;
|
|
21
|
-
constructor(options?:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
constructor(options?: InMemoryVectorStoreOptions);
|
|
34
|
+
static fromDocuments<T, Metadata extends VectorMetadata = VectorMetadata>(options: InMemoryVectorStoreFromDocumentsOptions<T, Metadata>): InMemoryVectorStore<T, Metadata>;
|
|
35
|
+
ensure(): Promise<void>;
|
|
36
|
+
validate(): Promise<void>;
|
|
37
|
+
upsert(options: VectorStoreUpsertOptions<T, Metadata>): Promise<void>;
|
|
38
|
+
get(options: {
|
|
39
|
+
id: string;
|
|
40
|
+
}): StoredDocument<T, Metadata> | undefined;
|
|
29
41
|
values(): Array<StoredDocument<T, Metadata>>;
|
|
30
42
|
len(): number;
|
|
31
43
|
isEmpty(): boolean;
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
search(request: VectorSearchRequest): Promise<Array<VectorSearchResult<T, Metadata>>>;
|
|
45
|
+
inspect(request: VectorInspectRequest): Promise<VectorInspectPage<T, Metadata>>;
|
|
46
|
+
private replaceDocuments;
|
|
47
|
+
private candidates;
|
|
34
48
|
private rebuildLshIndex;
|
|
35
49
|
private validateDocumentDimensions;
|
|
36
50
|
private validateQueryDimension;
|
|
37
51
|
}
|
|
38
|
-
declare
|
|
39
|
-
private readonly model;
|
|
40
|
-
private readonly store;
|
|
41
|
-
constructor(model: EmbeddingModel, store: InMemoryVectorStore<T, Metadata>);
|
|
42
|
-
search(request: VectorSearchRequest): Promise<Array<VectorSearchResult<T, Metadata>>>;
|
|
43
|
-
searchIds(request: VectorSearchRequest): Promise<Array<{
|
|
44
|
-
score: number;
|
|
45
|
-
id: string;
|
|
46
|
-
}>>;
|
|
47
|
-
inspect(request: VectorInspectRequest): Promise<VectorInspectPage<T, Metadata>>;
|
|
48
|
-
asTool(options: VectorSearchToolOptions): Tool<{
|
|
49
|
-
query: string;
|
|
50
|
-
topK?: number;
|
|
51
|
-
}, unknown>;
|
|
52
|
-
}
|
|
53
|
-
declare function createVectorSearchTool<T, Metadata extends VectorMetadata>(index: VectorSearchIndex<T, Metadata>, options: VectorSearchToolOptions): Tool<{
|
|
52
|
+
declare function createVectorSearchTool<T, Metadata extends VectorMetadata>(options: VectorSearchToolOptions<T, Metadata>): Tool<{
|
|
54
53
|
query: string;
|
|
55
54
|
topK?: number;
|
|
56
55
|
}, Array<VectorSearchResult<T, Metadata>>>;
|
|
57
56
|
|
|
58
|
-
export {
|
|
57
|
+
export { InMemoryVectorStore, type InMemoryVectorStoreFromDocumentsOptions, type InMemoryVectorStoreOptions, IndexStrategy, RetrieveDocumentsOptions, RetrieveHybridDocumentsOptions, VectorFilter, VectorInspectPage, VectorInspectRequest, VectorSearchRequest, VectorSearchResult, VectorSearchToolOptions, VectorStore, VectorStoreUpsertOptions, createVectorSearchTool, retrieveDocuments, vectorFilter };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
InMemoryVectorIndex,
|
|
3
2
|
InMemoryVectorStore,
|
|
4
3
|
createVectorSearchTool,
|
|
4
|
+
retrieveDocuments,
|
|
5
5
|
vectorFilter
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-77AIYARB.js";
|
|
7
|
+
import "../chunk-FMHLROPQ.js";
|
|
8
|
+
import "../chunk-TIZYTPJO.js";
|
|
9
|
+
import "../chunk-FN7HLLAZ.js";
|
|
10
10
|
export {
|
|
11
|
-
InMemoryVectorIndex,
|
|
12
11
|
InMemoryVectorStore,
|
|
13
12
|
createVectorSearchTool,
|
|
13
|
+
retrieveDocuments,
|
|
14
14
|
vectorFilter
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=index.js.map
|