@crewai-ts/core 0.1.12 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +174 -0
- package/dist/agent.d.ts +16 -18
- package/dist/auth.cjs +598 -0
- package/dist/auth.js +40 -0
- package/dist/{chunk-3PVW4JKT.js → chunk-C43UEMCX.js} +6712 -7268
- package/dist/chunk-CCOE6MLE.js +896 -0
- package/dist/chunk-HFQTF332.js +4455 -0
- package/dist/{chunk-BE4JYKSG.js → chunk-MM4ROIFG.js} +12 -1490
- package/dist/chunk-RH43TNKN.js +238 -0
- package/dist/chunk-S477WFUT.js +565 -0
- package/dist/chunk-SB7ADUQA.js +110 -0
- package/dist/chunk-T32G6KDW.js +40 -0
- package/dist/crew.d.ts +24 -26
- package/dist/events.cjs +7513 -0
- package/dist/events.js +406 -0
- package/dist/experimental-conversational.cjs +272 -0
- package/dist/experimental-conversational.js +26 -0
- package/dist/feature-hooks.cjs +149 -0
- package/dist/feature-hooks.d.ts +94 -0
- package/dist/feature-hooks.js +36 -0
- package/dist/index.cjs +33923 -64381
- package/dist/index.d.ts +2 -15
- package/dist/index.js +16720 -49562
- package/dist/input-provider.d.ts +3 -4
- package/dist/lite-agent.d.ts +4 -4
- package/dist/llm.cjs +7467 -0
- package/dist/llm.d.ts +0 -4
- package/dist/llm.js +225 -0
- package/dist/optional-yaml.d.ts +8 -0
- package/dist/project.d.ts +1 -1
- package/dist/schema-utils.cjs +968 -0
- package/dist/schema-utils.d.ts +1 -1
- package/dist/schema-utils.js +102 -0
- package/dist/state-provider-core.js +3 -2
- package/dist/task.d.ts +3 -4
- package/dist/tools.cjs +6872 -0
- package/dist/tools.d.ts +0 -60
- package/dist/tools.js +114 -0
- package/dist/types.cjs +68 -0
- package/dist/types.js +14 -0
- package/package.json +52 -111
- package/dist/a2a.d.ts +0 -1684
- package/dist/a2ui-schemas.d.ts +0 -3312
- package/dist/a2ui.d.ts +0 -379
- package/dist/flow-conversation.d.ts +0 -90
- package/dist/flow-definition.d.ts +0 -195
- package/dist/flow-persistence.d.ts +0 -107
- package/dist/flow-visualization.d.ts +0 -77
- package/dist/flow.d.ts +0 -927
- package/dist/knowledge.d.ts +0 -353
- package/dist/mcp-DS7UMYAM.js +0 -62
- package/dist/mcp.d.ts +0 -315
- package/dist/memory.d.ts +0 -915
- package/dist/openai-completion.d.ts +0 -327
- package/dist/provider-completions.d.ts +0 -596
- package/dist/rag.d.ts +0 -1074
package/dist/rag.d.ts
DELETED
|
@@ -1,1074 +0,0 @@
|
|
|
1
|
-
export declare const DISCRIMINATOR = "provider";
|
|
2
|
-
export declare const DEFAULT_RAG_CONFIG_PATH = "crewai.rag.chromadb.config";
|
|
3
|
-
export declare const DEFAULT_RAG_CONFIG_CLASS = "ChromaDBConfig";
|
|
4
|
-
export declare const DEFAULT_CHROMADB_TENANT = "default_tenant";
|
|
5
|
-
export declare const DEFAULT_CHROMADB_DATABASE = "default_database";
|
|
6
|
-
export declare const DEFAULT_CHROMADB_STORAGE_PATH = "./chroma";
|
|
7
|
-
export declare const DEFAULT_TENANT = "default_tenant";
|
|
8
|
-
export declare const DEFAULT_DATABASE = "default_database";
|
|
9
|
-
export declare const MIN_COLLECTION_LENGTH = 3;
|
|
10
|
-
export declare const MAX_COLLECTION_LENGTH = 63;
|
|
11
|
-
export declare const DEFAULT_COLLECTION = "default_collection";
|
|
12
|
-
export declare const INVALID_CHARS_PATTERN: RegExp;
|
|
13
|
-
export declare const IPV4_PATTERN: RegExp;
|
|
14
|
-
export declare const DEFAULT_QDRANT_STORAGE_PATH = "./qdrant";
|
|
15
|
-
export declare const DEFAULT_QDRANT_EMBEDDING_MODEL = "BAAI/bge-small-en";
|
|
16
|
-
export declare const DEFAULT_VECTOR_PARAMS: Readonly<{
|
|
17
|
-
size: 384;
|
|
18
|
-
distance: "Cosine";
|
|
19
|
-
}>;
|
|
20
|
-
export declare const DEFAULT_EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2";
|
|
21
|
-
export declare const DEFAULT_STORAGE_PATH = "./qdrant";
|
|
22
|
-
export type RagMetadataValue = string | number | boolean;
|
|
23
|
-
export type RagMetadata = Record<string, RagMetadataValue>;
|
|
24
|
-
export type BaseRecord = {
|
|
25
|
-
docId?: string;
|
|
26
|
-
doc_id?: string;
|
|
27
|
-
content: string;
|
|
28
|
-
metadata?: RagMetadata | readonly RagMetadata[] | null;
|
|
29
|
-
};
|
|
30
|
-
export type BaseRecordOptions = BaseRecord;
|
|
31
|
-
export declare const BaseRecord: {
|
|
32
|
-
new (options: BaseRecordOptions): {
|
|
33
|
-
readonly docId: string | null;
|
|
34
|
-
readonly doc_id: string | null;
|
|
35
|
-
readonly content: string;
|
|
36
|
-
readonly metadata: RagMetadata | readonly RagMetadata[] | null;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export declare const BaseClient: Readonly<{
|
|
40
|
-
kind: "BaseClient";
|
|
41
|
-
}>;
|
|
42
|
-
export type Embedding = readonly number[];
|
|
43
|
-
export declare const Embedding: ArrayConstructor;
|
|
44
|
-
export type Embeddings = readonly Embedding[];
|
|
45
|
-
export declare const Embeddings: ArrayConstructor;
|
|
46
|
-
export type EmbeddingFunction = (...args: readonly unknown[]) => unknown;
|
|
47
|
-
export declare const EmbeddingFunction: Readonly<{
|
|
48
|
-
kind: "EmbeddingFunction";
|
|
49
|
-
}>;
|
|
50
|
-
export type AsyncEmbeddingFunction = (...args: readonly unknown[]) => Promise<unknown>;
|
|
51
|
-
export declare const AsyncEmbeddingFunction: Readonly<{
|
|
52
|
-
kind: "AsyncEmbeddingFunction";
|
|
53
|
-
}>;
|
|
54
|
-
export type QueryEmbedding = readonly number[];
|
|
55
|
-
export declare const QueryEmbedding: ArrayConstructor;
|
|
56
|
-
export declare const QdrantClientType: Readonly<{
|
|
57
|
-
kind: "QdrantClientType";
|
|
58
|
-
}>;
|
|
59
|
-
export declare const BasicConditions: Readonly<{
|
|
60
|
-
kind: "BasicConditions";
|
|
61
|
-
}>;
|
|
62
|
-
export declare const StructuralConditions: Readonly<{
|
|
63
|
-
kind: "StructuralConditions";
|
|
64
|
-
}>;
|
|
65
|
-
export declare const FilterCondition: Readonly<{
|
|
66
|
-
kind: "FilterCondition";
|
|
67
|
-
}>;
|
|
68
|
-
export declare const MetadataFilterValue: Readonly<{
|
|
69
|
-
kind: "MetadataFilterValue";
|
|
70
|
-
}>;
|
|
71
|
-
export declare const MetadataFilter: Readonly<{
|
|
72
|
-
kind: "MetadataFilter";
|
|
73
|
-
}>;
|
|
74
|
-
export declare const QdrantClientParams: Readonly<{
|
|
75
|
-
kind: "QdrantClientParams";
|
|
76
|
-
}>;
|
|
77
|
-
export declare const CommonCreateFields: Readonly<{
|
|
78
|
-
kind: "CommonCreateFields";
|
|
79
|
-
}>;
|
|
80
|
-
export declare const QdrantCollectionCreateParams: Readonly<{
|
|
81
|
-
kind: "QdrantCollectionCreateParams";
|
|
82
|
-
}>;
|
|
83
|
-
export declare const CreateCollectionParams: Readonly<{
|
|
84
|
-
kind: "CreateCollectionParams";
|
|
85
|
-
}>;
|
|
86
|
-
export declare const PreparedSearchParams: Readonly<{
|
|
87
|
-
kind: "PreparedSearchParams";
|
|
88
|
-
}>;
|
|
89
|
-
export declare const QdrantEmbeddingFunctionWrapper: {
|
|
90
|
-
__get_pydantic_core_schema__(): unknown;
|
|
91
|
-
};
|
|
92
|
-
export declare const ChromaDBClientType: Readonly<{
|
|
93
|
-
kind: "ChromaDBClientType";
|
|
94
|
-
}>;
|
|
95
|
-
export declare const ChromaEmbeddingFunctionWrapper: {
|
|
96
|
-
__get_pydantic_core_schema__(): unknown;
|
|
97
|
-
};
|
|
98
|
-
export declare class PreparedDocuments {
|
|
99
|
-
readonly ids: string[];
|
|
100
|
-
readonly texts: string[];
|
|
101
|
-
readonly metadatas: Array<Record<string, string | number | boolean>>;
|
|
102
|
-
constructor(ids?: string[], texts?: string[], metadatas?: Array<Record<string, string | number | boolean>>);
|
|
103
|
-
[Symbol.iterator](): IterableIterator<unknown>;
|
|
104
|
-
}
|
|
105
|
-
export declare class ExtractedSearchParams {
|
|
106
|
-
readonly collection_name: string;
|
|
107
|
-
readonly query: string;
|
|
108
|
-
readonly limit: number;
|
|
109
|
-
readonly metadata_filter: Record<string, unknown> | null;
|
|
110
|
-
readonly score_threshold: number | null;
|
|
111
|
-
readonly where: unknown;
|
|
112
|
-
readonly where_document: unknown;
|
|
113
|
-
readonly include: unknown;
|
|
114
|
-
constructor(options?: {
|
|
115
|
-
collection_name?: string;
|
|
116
|
-
collectionName?: string;
|
|
117
|
-
query?: string;
|
|
118
|
-
limit?: number;
|
|
119
|
-
metadata_filter?: Record<string, unknown> | null;
|
|
120
|
-
metadataFilter?: Record<string, unknown> | null;
|
|
121
|
-
score_threshold?: number | null;
|
|
122
|
-
scoreThreshold?: number | null;
|
|
123
|
-
where?: unknown;
|
|
124
|
-
where_document?: unknown;
|
|
125
|
-
whereDocument?: unknown;
|
|
126
|
-
include?: unknown;
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
export declare const ChromaDBCollectionCreateParams: Readonly<{
|
|
130
|
-
kind: "ChromaDBCollectionCreateParams";
|
|
131
|
-
}>;
|
|
132
|
-
export declare const ChromaDBCollectionSearchParams: Readonly<{
|
|
133
|
-
kind: "ChromaDBCollectionSearchParams";
|
|
134
|
-
}>;
|
|
135
|
-
export type Embeddable = readonly string[] | readonly unknown[];
|
|
136
|
-
export declare const Embeddable: Readonly<{
|
|
137
|
-
kind: "Embeddable";
|
|
138
|
-
}>;
|
|
139
|
-
export declare const Documents: ArrayConstructor;
|
|
140
|
-
export declare const Images: ArrayConstructor;
|
|
141
|
-
export declare const PyEmbedding: ArrayConstructor;
|
|
142
|
-
export declare const PyEmbeddings: ArrayConstructor;
|
|
143
|
-
export declare const ScalarType: Readonly<{
|
|
144
|
-
kind: "ScalarType";
|
|
145
|
-
}>;
|
|
146
|
-
export declare const NumberType: Readonly<{
|
|
147
|
-
kind: "NumberType";
|
|
148
|
-
}>;
|
|
149
|
-
export declare const IntegerType: Readonly<{
|
|
150
|
-
kind: "IntegerType";
|
|
151
|
-
}>;
|
|
152
|
-
export declare const FloatingType: Readonly<{
|
|
153
|
-
kind: "FloatingType";
|
|
154
|
-
}>;
|
|
155
|
-
export declare const DType32: Readonly<{
|
|
156
|
-
kind: "DType32";
|
|
157
|
-
}>;
|
|
158
|
-
export declare const DType64: Readonly<{
|
|
159
|
-
kind: "DType64";
|
|
160
|
-
}>;
|
|
161
|
-
export declare const DTypeCommon: Readonly<{
|
|
162
|
-
kind: "DTypeCommon";
|
|
163
|
-
}>;
|
|
164
|
-
export type TypedEmbeddingFunction<TInput = Embeddable> = {
|
|
165
|
-
(input: TInput): Embeddings | Embedding | Promise<Embeddings | Embedding>;
|
|
166
|
-
embedQuery?: (input: TInput) => Embeddings | Embedding | Promise<Embeddings | Embedding>;
|
|
167
|
-
embed_query?: (input: TInput) => Embeddings | Embedding | Promise<Embeddings | Embedding>;
|
|
168
|
-
};
|
|
169
|
-
export type AllowedEmbeddingProvider = "azure" | "amazon-bedrock" | "cohere" | "custom" | "google-generativeai" | "google" | "google-vertex" | "huggingface" | "instructor" | "jina" | "ollama" | "onnx" | "openai" | "openclip" | "roboflow" | "sentence-transformer" | "text2vec" | "voyageai" | "watsonx";
|
|
170
|
-
export declare const AllowedEmbeddingProviders: readonly ["azure", "amazon-bedrock", "cohere", "custom", "google-generativeai", "google-vertex", "huggingface", "instructor", "jina", "ollama", "onnx", "openai", "openclip", "roboflow", "sentence-transformer", "text2vec", "voyageai", "watsonx"];
|
|
171
|
-
export type BaseProviderSpec<TProvider extends AllowedEmbeddingProvider = AllowedEmbeddingProvider, TConfig extends Record<string, unknown> = Record<string, unknown>> = {
|
|
172
|
-
provider: TProvider;
|
|
173
|
-
config?: TConfig;
|
|
174
|
-
};
|
|
175
|
-
export type AzureProviderConfig = {
|
|
176
|
-
api_key?: string;
|
|
177
|
-
api_base?: string;
|
|
178
|
-
api_type?: string;
|
|
179
|
-
api_version?: string;
|
|
180
|
-
model?: string;
|
|
181
|
-
model_name?: string;
|
|
182
|
-
default_headers?: Record<string, unknown>;
|
|
183
|
-
dimensions?: number;
|
|
184
|
-
deployment_id: string;
|
|
185
|
-
organization_id?: string;
|
|
186
|
-
};
|
|
187
|
-
export declare const AzureProviderConfig: Readonly<{
|
|
188
|
-
kind: "AzureProviderConfig";
|
|
189
|
-
}>;
|
|
190
|
-
export type AzureProviderSpec = BaseProviderSpec<"azure", AzureProviderConfig>;
|
|
191
|
-
export declare const AzureProviderSpec: string;
|
|
192
|
-
export type BedrockProviderConfig = {
|
|
193
|
-
model_name?: string;
|
|
194
|
-
session?: unknown;
|
|
195
|
-
};
|
|
196
|
-
export declare const BedrockProviderConfig: Readonly<{
|
|
197
|
-
kind: "BedrockProviderConfig";
|
|
198
|
-
}>;
|
|
199
|
-
export type BedrockProviderSpec = BaseProviderSpec<"amazon-bedrock", BedrockProviderConfig>;
|
|
200
|
-
export declare const BedrockProviderSpec: string;
|
|
201
|
-
export declare function create_aws_session(): unknown;
|
|
202
|
-
export declare class BedrockProvider {
|
|
203
|
-
readonly provider = "amazon-bedrock";
|
|
204
|
-
readonly model_name: string;
|
|
205
|
-
readonly session: unknown;
|
|
206
|
-
constructor(options?: BedrockProviderConfig);
|
|
207
|
-
build(): TypedEmbeddingFunction;
|
|
208
|
-
private embed;
|
|
209
|
-
}
|
|
210
|
-
export type CohereProviderConfig = {
|
|
211
|
-
api_key?: string;
|
|
212
|
-
model?: string;
|
|
213
|
-
model_name?: string;
|
|
214
|
-
};
|
|
215
|
-
export declare const CohereProviderConfig: Readonly<{
|
|
216
|
-
kind: "CohereProviderConfig";
|
|
217
|
-
}>;
|
|
218
|
-
export type CohereProviderSpec = BaseProviderSpec<"cohere", CohereProviderConfig>;
|
|
219
|
-
export declare const CohereProviderSpec: string;
|
|
220
|
-
export type CustomProviderConfig = {
|
|
221
|
-
embeddingCallable?: TypedEmbeddingFunction | null;
|
|
222
|
-
embedding_callable?: TypedEmbeddingFunction | null;
|
|
223
|
-
};
|
|
224
|
-
export declare const CustomProviderConfig: Readonly<{
|
|
225
|
-
kind: "CustomProviderConfig";
|
|
226
|
-
}>;
|
|
227
|
-
export type CustomProviderSpec = BaseProviderSpec<"custom", CustomProviderConfig>;
|
|
228
|
-
export declare const CustomProviderSpec: string;
|
|
229
|
-
export type GenerativeAiProviderConfig = {
|
|
230
|
-
api_key?: string;
|
|
231
|
-
model?: "gemini-embedding-001" | "text-embedding-005" | "text-multilingual-embedding-002";
|
|
232
|
-
model_name?: "gemini-embedding-001" | "text-embedding-005" | "text-multilingual-embedding-002";
|
|
233
|
-
task_type?: string;
|
|
234
|
-
api_url?: string;
|
|
235
|
-
};
|
|
236
|
-
export declare const GenerativeAiProviderConfig: Readonly<{
|
|
237
|
-
kind: "GenerativeAiProviderConfig";
|
|
238
|
-
}>;
|
|
239
|
-
export type GenerativeAiProviderSpec = BaseProviderSpec<"google-generativeai", GenerativeAiProviderConfig>;
|
|
240
|
-
export declare const GenerativeAiProviderSpec: string;
|
|
241
|
-
export type VertexAIProviderConfig = {
|
|
242
|
-
api_key?: string;
|
|
243
|
-
model?: string;
|
|
244
|
-
model_name?: string;
|
|
245
|
-
project_id?: string;
|
|
246
|
-
location?: string;
|
|
247
|
-
region?: string;
|
|
248
|
-
task_type?: string;
|
|
249
|
-
output_dimensionality?: number;
|
|
250
|
-
api_url?: string;
|
|
251
|
-
};
|
|
252
|
-
export declare const VertexAIProviderConfig: Readonly<{
|
|
253
|
-
kind: "VertexAIProviderConfig";
|
|
254
|
-
}>;
|
|
255
|
-
export type VertexAIProviderSpec = BaseProviderSpec<"google-vertex", VertexAIProviderConfig>;
|
|
256
|
-
export declare const VertexAIProviderSpec: string;
|
|
257
|
-
export type HuggingFaceProviderConfig = {
|
|
258
|
-
api_key?: string;
|
|
259
|
-
model?: string;
|
|
260
|
-
model_name?: string;
|
|
261
|
-
api_url?: string;
|
|
262
|
-
};
|
|
263
|
-
export declare const HuggingFaceProviderConfig: Readonly<{
|
|
264
|
-
kind: "HuggingFaceProviderConfig";
|
|
265
|
-
}>;
|
|
266
|
-
export type HuggingFaceProviderSpec = BaseProviderSpec<"huggingface", HuggingFaceProviderConfig>;
|
|
267
|
-
export declare const HuggingFaceProviderSpec: string;
|
|
268
|
-
export type WatsonXProviderConfig = {
|
|
269
|
-
model_id?: string;
|
|
270
|
-
url?: string;
|
|
271
|
-
params?: Record<string, string | Record<string, string>>;
|
|
272
|
-
credentials?: unknown;
|
|
273
|
-
project_id?: string;
|
|
274
|
-
space_id?: string;
|
|
275
|
-
api_client?: unknown;
|
|
276
|
-
verify?: boolean | string;
|
|
277
|
-
persistent_connection?: boolean;
|
|
278
|
-
batch_size?: number;
|
|
279
|
-
concurrency_limit?: number;
|
|
280
|
-
max_retries?: number;
|
|
281
|
-
delay_time?: number;
|
|
282
|
-
retry_status_codes?: readonly number[];
|
|
283
|
-
api_key?: string;
|
|
284
|
-
[key: string]: unknown;
|
|
285
|
-
};
|
|
286
|
-
export declare const WatsonXProviderConfig: Readonly<{
|
|
287
|
-
kind: "WatsonXProviderConfig";
|
|
288
|
-
}>;
|
|
289
|
-
export type WatsonXProviderSpec = BaseProviderSpec<"watsonx", WatsonXProviderConfig>;
|
|
290
|
-
export declare const WatsonXProviderSpec: string;
|
|
291
|
-
export type LocalEmbeddingRuntime = TypedEmbeddingFunction | Record<string, unknown>;
|
|
292
|
-
export type InstructorProviderConfig = {
|
|
293
|
-
model_name?: string;
|
|
294
|
-
model?: string | LocalEmbeddingRuntime;
|
|
295
|
-
device?: string;
|
|
296
|
-
instruction?: string | null;
|
|
297
|
-
embeddingCallable?: TypedEmbeddingFunction;
|
|
298
|
-
embedding_callable?: TypedEmbeddingFunction;
|
|
299
|
-
runtime?: LocalEmbeddingRuntime;
|
|
300
|
-
client?: LocalEmbeddingRuntime;
|
|
301
|
-
};
|
|
302
|
-
export declare const InstructorProviderConfig: Readonly<{
|
|
303
|
-
kind: "InstructorProviderConfig";
|
|
304
|
-
}>;
|
|
305
|
-
export type InstructorProviderSpec = BaseProviderSpec<"instructor", InstructorProviderConfig>;
|
|
306
|
-
export declare const InstructorProviderSpec: string;
|
|
307
|
-
export type JinaProviderConfig = {
|
|
308
|
-
api_key?: string;
|
|
309
|
-
model?: string;
|
|
310
|
-
model_name?: string;
|
|
311
|
-
};
|
|
312
|
-
export declare const JinaProviderConfig: Readonly<{
|
|
313
|
-
kind: "JinaProviderConfig";
|
|
314
|
-
}>;
|
|
315
|
-
export type JinaProviderSpec = BaseProviderSpec<"jina", JinaProviderConfig>;
|
|
316
|
-
export declare const JinaProviderSpec: string;
|
|
317
|
-
export type OllamaProviderConfig = {
|
|
318
|
-
url?: string;
|
|
319
|
-
model_name?: string;
|
|
320
|
-
model?: string;
|
|
321
|
-
};
|
|
322
|
-
export declare const OllamaProviderConfig: Readonly<{
|
|
323
|
-
kind: "OllamaProviderConfig";
|
|
324
|
-
}>;
|
|
325
|
-
export type OllamaProviderSpec = BaseProviderSpec<"ollama", OllamaProviderConfig>;
|
|
326
|
-
export declare const OllamaProviderSpec: string;
|
|
327
|
-
export type ONNXProviderConfig = {
|
|
328
|
-
preferred_providers?: readonly string[] | null;
|
|
329
|
-
embeddingCallable?: TypedEmbeddingFunction;
|
|
330
|
-
embedding_callable?: TypedEmbeddingFunction;
|
|
331
|
-
runtime?: LocalEmbeddingRuntime;
|
|
332
|
-
model?: LocalEmbeddingRuntime;
|
|
333
|
-
client?: LocalEmbeddingRuntime;
|
|
334
|
-
};
|
|
335
|
-
export declare const ONNXProviderConfig: Readonly<{
|
|
336
|
-
kind: "ONNXProviderConfig";
|
|
337
|
-
}>;
|
|
338
|
-
export type ONNXProviderSpec = BaseProviderSpec<"onnx", ONNXProviderConfig>;
|
|
339
|
-
export declare const ONNXProviderSpec: string;
|
|
340
|
-
export type OpenAIProviderConfig = {
|
|
341
|
-
api_key?: string;
|
|
342
|
-
model?: string;
|
|
343
|
-
model_name?: string;
|
|
344
|
-
api_base?: string;
|
|
345
|
-
api_type?: string;
|
|
346
|
-
api_version?: string;
|
|
347
|
-
default_headers?: Record<string, unknown>;
|
|
348
|
-
dimensions?: number;
|
|
349
|
-
deployment_id?: string;
|
|
350
|
-
organization_id?: string;
|
|
351
|
-
};
|
|
352
|
-
export declare const OpenAIProviderConfig: Readonly<{
|
|
353
|
-
kind: "OpenAIProviderConfig";
|
|
354
|
-
}>;
|
|
355
|
-
export type OpenAIProviderSpec = BaseProviderSpec<"openai", OpenAIProviderConfig>;
|
|
356
|
-
export declare const OpenAIProviderSpec: string;
|
|
357
|
-
export type OpenCLIPProviderConfig = {
|
|
358
|
-
model_name?: string;
|
|
359
|
-
model?: string | LocalEmbeddingRuntime;
|
|
360
|
-
checkpoint?: string;
|
|
361
|
-
device?: string;
|
|
362
|
-
embeddingCallable?: TypedEmbeddingFunction;
|
|
363
|
-
embedding_callable?: TypedEmbeddingFunction;
|
|
364
|
-
runtime?: LocalEmbeddingRuntime;
|
|
365
|
-
client?: LocalEmbeddingRuntime;
|
|
366
|
-
};
|
|
367
|
-
export declare const OpenCLIPProviderConfig: Readonly<{
|
|
368
|
-
kind: "OpenCLIPProviderConfig";
|
|
369
|
-
}>;
|
|
370
|
-
export type OpenCLIPProviderSpec = BaseProviderSpec<"openclip", OpenCLIPProviderConfig>;
|
|
371
|
-
export declare const OpenCLIPProviderSpec: string;
|
|
372
|
-
export type RoboflowProviderConfig = {
|
|
373
|
-
api_key?: string;
|
|
374
|
-
api_url?: string;
|
|
375
|
-
};
|
|
376
|
-
export declare const RoboflowProviderConfig: Readonly<{
|
|
377
|
-
kind: "RoboflowProviderConfig";
|
|
378
|
-
}>;
|
|
379
|
-
export type RoboflowProviderSpec = BaseProviderSpec<"roboflow", RoboflowProviderConfig>;
|
|
380
|
-
export declare const RoboflowProviderSpec: string;
|
|
381
|
-
export type SentenceTransformerProviderConfig = {
|
|
382
|
-
model_name?: string;
|
|
383
|
-
model?: string | LocalEmbeddingRuntime;
|
|
384
|
-
device?: string;
|
|
385
|
-
normalize_embeddings?: boolean;
|
|
386
|
-
embeddingCallable?: TypedEmbeddingFunction;
|
|
387
|
-
embedding_callable?: TypedEmbeddingFunction;
|
|
388
|
-
runtime?: LocalEmbeddingRuntime;
|
|
389
|
-
client?: LocalEmbeddingRuntime;
|
|
390
|
-
};
|
|
391
|
-
export declare const SentenceTransformerProviderConfig: Readonly<{
|
|
392
|
-
kind: "SentenceTransformerProviderConfig";
|
|
393
|
-
}>;
|
|
394
|
-
export type SentenceTransformerProviderSpec = BaseProviderSpec<"sentence-transformer", SentenceTransformerProviderConfig>;
|
|
395
|
-
export declare const SentenceTransformerProviderSpec: string;
|
|
396
|
-
export type Text2VecProviderConfig = {
|
|
397
|
-
model_name?: string;
|
|
398
|
-
model?: string | LocalEmbeddingRuntime;
|
|
399
|
-
embeddingCallable?: TypedEmbeddingFunction;
|
|
400
|
-
embedding_callable?: TypedEmbeddingFunction;
|
|
401
|
-
runtime?: LocalEmbeddingRuntime;
|
|
402
|
-
client?: LocalEmbeddingRuntime;
|
|
403
|
-
};
|
|
404
|
-
export declare const Text2VecProviderConfig: Readonly<{
|
|
405
|
-
kind: "Text2VecProviderConfig";
|
|
406
|
-
}>;
|
|
407
|
-
export type Text2VecProviderSpec = BaseProviderSpec<"text2vec", Text2VecProviderConfig>;
|
|
408
|
-
export declare const Text2VecProviderSpec: string;
|
|
409
|
-
export type VoyageAIProviderConfig = {
|
|
410
|
-
api_key?: string;
|
|
411
|
-
model?: string;
|
|
412
|
-
input_type?: string;
|
|
413
|
-
truncation?: boolean;
|
|
414
|
-
output_dtype?: string;
|
|
415
|
-
output_dimension?: number;
|
|
416
|
-
max_retries?: number;
|
|
417
|
-
timeout?: number;
|
|
418
|
-
api_url?: string;
|
|
419
|
-
};
|
|
420
|
-
export declare const VoyageAIProviderConfig: Readonly<{
|
|
421
|
-
kind: "VoyageAIProviderConfig";
|
|
422
|
-
}>;
|
|
423
|
-
export type VoyageAIProviderSpec = BaseProviderSpec<"voyageai", VoyageAIProviderConfig>;
|
|
424
|
-
export declare const VoyageAIProviderSpec: string;
|
|
425
|
-
export type ProviderSpec = AzureProviderSpec | BedrockProviderSpec | CohereProviderSpec | CustomProviderSpec | GenerativeAiProviderSpec | HuggingFaceProviderSpec | InstructorProviderSpec | JinaProviderSpec | OllamaProviderSpec | ONNXProviderSpec | OpenAIProviderSpec | OpenCLIPProviderSpec | RoboflowProviderSpec | SentenceTransformerProviderSpec | Text2VecProviderSpec | VertexAIProviderSpec | VoyageAIProviderSpec | WatsonXProviderSpec;
|
|
426
|
-
export declare const ProviderSpec: string;
|
|
427
|
-
export type EmbedderConfig = ProviderSpec | BaseEmbeddingsProvider | TypedEmbeddingFunction;
|
|
428
|
-
export declare const EmbedderConfig: Readonly<{
|
|
429
|
-
kind: "EmbedderConfig";
|
|
430
|
-
}>;
|
|
431
|
-
export declare class BaseEmbeddingsProvider<TEmbeddingFunction extends TypedEmbeddingFunction = TypedEmbeddingFunction> {
|
|
432
|
-
readonly embeddingCallable: TEmbeddingFunction;
|
|
433
|
-
readonly embedding_callable: TEmbeddingFunction;
|
|
434
|
-
readonly config: Record<string, unknown>;
|
|
435
|
-
[key: string]: unknown;
|
|
436
|
-
constructor(options: {
|
|
437
|
-
embeddingCallable?: TEmbeddingFunction;
|
|
438
|
-
embedding_callable?: TEmbeddingFunction;
|
|
439
|
-
} & Record<string, unknown>);
|
|
440
|
-
build(): TEmbeddingFunction;
|
|
441
|
-
}
|
|
442
|
-
export type BaseEmbeddingsCallable<TInput = Embeddable> = TypedEmbeddingFunction<TInput>;
|
|
443
|
-
export declare const BaseEmbeddingsCallable: FunctionConstructor;
|
|
444
|
-
export declare class OpenAIEmbeddingFunction {
|
|
445
|
-
readonly api_key: string | null;
|
|
446
|
-
readonly model_name: string;
|
|
447
|
-
readonly api_base: string | null;
|
|
448
|
-
readonly api_type: string | null;
|
|
449
|
-
readonly api_version: string | null;
|
|
450
|
-
readonly default_headers: Record<string, unknown> | null;
|
|
451
|
-
readonly dimensions: number | null;
|
|
452
|
-
readonly deployment_id: string | null;
|
|
453
|
-
readonly organization_id: string | null;
|
|
454
|
-
constructor(options?: OpenAIProviderConfig);
|
|
455
|
-
call(input: Embeddable): Promise<Embeddings>;
|
|
456
|
-
__call__(input: Embeddable): Promise<Embeddings>;
|
|
457
|
-
asCallable(): TypedEmbeddingFunction;
|
|
458
|
-
private isAzure;
|
|
459
|
-
private endpointUrl;
|
|
460
|
-
private requestHeaders;
|
|
461
|
-
private requestBody;
|
|
462
|
-
}
|
|
463
|
-
export declare class AzureProvider extends BaseEmbeddingsProvider {
|
|
464
|
-
readonly provider = "azure";
|
|
465
|
-
constructor(options?: AzureProviderConfig);
|
|
466
|
-
}
|
|
467
|
-
export declare class CohereEmbeddingFunction {
|
|
468
|
-
readonly api_key: string | null;
|
|
469
|
-
readonly model_name: string;
|
|
470
|
-
readonly api_url: string;
|
|
471
|
-
constructor(options?: CohereProviderConfig & {
|
|
472
|
-
api_url?: string;
|
|
473
|
-
});
|
|
474
|
-
call(input: Embeddable): Promise<Embeddings>;
|
|
475
|
-
__call__(input: Embeddable): Promise<Embeddings>;
|
|
476
|
-
asCallable(): TypedEmbeddingFunction;
|
|
477
|
-
private requestHeaders;
|
|
478
|
-
}
|
|
479
|
-
export declare class CohereProvider extends BaseEmbeddingsProvider {
|
|
480
|
-
readonly provider = "cohere";
|
|
481
|
-
constructor(options?: CohereProviderConfig);
|
|
482
|
-
}
|
|
483
|
-
export declare class CustomEmbeddingFunction {
|
|
484
|
-
readonly embeddingCallable: TypedEmbeddingFunction;
|
|
485
|
-
constructor(embeddingCallable?: TypedEmbeddingFunction);
|
|
486
|
-
call(input: Embeddable): unknown;
|
|
487
|
-
__call__(input: Embeddable): unknown;
|
|
488
|
-
}
|
|
489
|
-
export declare class CustomProvider extends BaseEmbeddingsProvider {
|
|
490
|
-
readonly provider = "custom";
|
|
491
|
-
constructor(options?: CustomProviderConfig);
|
|
492
|
-
}
|
|
493
|
-
export declare class GoogleGenAIVertexEmbeddingFunction {
|
|
494
|
-
static readonly LEGACY_MODELS: Set<string>;
|
|
495
|
-
readonly api_key: string | null;
|
|
496
|
-
readonly model_name: string;
|
|
497
|
-
readonly project_id: string | null;
|
|
498
|
-
readonly location: string;
|
|
499
|
-
readonly task_type: string;
|
|
500
|
-
readonly output_dimensionality: number | null;
|
|
501
|
-
readonly api_url: string | null;
|
|
502
|
-
constructor(options?: VertexAIProviderConfig);
|
|
503
|
-
static name(): string;
|
|
504
|
-
call(input: Embeddable): Promise<Embeddings>;
|
|
505
|
-
_initLegacyClient(options?: VertexAIProviderConfig): this;
|
|
506
|
-
_init_legacy_client(options?: VertexAIProviderConfig): this;
|
|
507
|
-
_initGenaiClient(options?: VertexAIProviderConfig): this;
|
|
508
|
-
_init_genai_client(options?: VertexAIProviderConfig): this;
|
|
509
|
-
_callLegacy(input: readonly string[]): Promise<Embeddings>;
|
|
510
|
-
_call_legacy(input: readonly string[]): Promise<Embeddings>;
|
|
511
|
-
_callGenai(input: readonly string[]): Promise<Embeddings>;
|
|
512
|
-
_call_genai(input: readonly string[]): Promise<Embeddings>;
|
|
513
|
-
__call__(input: Embeddable): Promise<Embeddings>;
|
|
514
|
-
asCallable(): TypedEmbeddingFunction;
|
|
515
|
-
private isLegacyModel;
|
|
516
|
-
private endpointUrl;
|
|
517
|
-
}
|
|
518
|
-
export declare class GoogleGenerativeAiEmbeddingFunction {
|
|
519
|
-
readonly api_key: string | null;
|
|
520
|
-
readonly model_name: string;
|
|
521
|
-
readonly task_type: string;
|
|
522
|
-
readonly api_url: string | null;
|
|
523
|
-
constructor(options?: GenerativeAiProviderConfig);
|
|
524
|
-
static name(): string;
|
|
525
|
-
call(input: Embeddable): Promise<Embeddings>;
|
|
526
|
-
__call__(input: Embeddable): Promise<Embeddings>;
|
|
527
|
-
asCallable(): TypedEmbeddingFunction;
|
|
528
|
-
private endpointUrl;
|
|
529
|
-
}
|
|
530
|
-
export declare class GenerativeAiProvider extends BaseEmbeddingsProvider {
|
|
531
|
-
readonly provider = "google-generativeai";
|
|
532
|
-
constructor(options?: GenerativeAiProviderConfig);
|
|
533
|
-
}
|
|
534
|
-
export declare class VertexAIProvider extends BaseEmbeddingsProvider {
|
|
535
|
-
readonly provider = "google-vertex";
|
|
536
|
-
constructor(options?: VertexAIProviderConfig);
|
|
537
|
-
}
|
|
538
|
-
export declare class HuggingFaceEmbeddingFunction {
|
|
539
|
-
readonly api_key: string | null;
|
|
540
|
-
readonly model_name: string;
|
|
541
|
-
readonly api_url: string;
|
|
542
|
-
constructor(options?: HuggingFaceProviderConfig);
|
|
543
|
-
call(input: Embeddable): Promise<Embeddings>;
|
|
544
|
-
__call__(input: Embeddable): Promise<Embeddings>;
|
|
545
|
-
asCallable(): TypedEmbeddingFunction;
|
|
546
|
-
private requestHeaders;
|
|
547
|
-
}
|
|
548
|
-
export declare class HuggingFaceProvider extends BaseEmbeddingsProvider {
|
|
549
|
-
readonly provider = "huggingface";
|
|
550
|
-
constructor(options?: HuggingFaceProviderConfig);
|
|
551
|
-
}
|
|
552
|
-
export declare class WatsonXEmbeddingFunction {
|
|
553
|
-
readonly config: Record<string, unknown>;
|
|
554
|
-
constructor(options?: Record<string, unknown>);
|
|
555
|
-
static name(): string;
|
|
556
|
-
call(input: Embeddable): Promise<Embeddings>;
|
|
557
|
-
__call__(input: Embeddable): Promise<Embeddings>;
|
|
558
|
-
asCallable(): TypedEmbeddingFunction;
|
|
559
|
-
private buildRequest;
|
|
560
|
-
}
|
|
561
|
-
export declare class WatsonXProvider extends BaseEmbeddingsProvider {
|
|
562
|
-
readonly provider = "watsonx";
|
|
563
|
-
constructor(options?: WatsonXProviderConfig);
|
|
564
|
-
validateSpaceOrProject(): this;
|
|
565
|
-
validate_space_or_project(): this;
|
|
566
|
-
}
|
|
567
|
-
type LocalEmbeddingInputMapper = (values: readonly string[]) => unknown;
|
|
568
|
-
declare class RuntimeEmbeddingFunction {
|
|
569
|
-
readonly providerName: string;
|
|
570
|
-
readonly runtime: LocalEmbeddingRuntime | null;
|
|
571
|
-
readonly mapInput: LocalEmbeddingInputMapper;
|
|
572
|
-
constructor(options: {
|
|
573
|
-
providerName: string;
|
|
574
|
-
runtime?: LocalEmbeddingRuntime | null;
|
|
575
|
-
mapInput?: LocalEmbeddingInputMapper;
|
|
576
|
-
});
|
|
577
|
-
call(input: Embeddable): Promise<Embeddings>;
|
|
578
|
-
__call__(input: Embeddable): Promise<Embeddings>;
|
|
579
|
-
asCallable(): TypedEmbeddingFunction;
|
|
580
|
-
}
|
|
581
|
-
export declare class InstructorEmbeddingFunction extends RuntimeEmbeddingFunction {
|
|
582
|
-
readonly model_name: string;
|
|
583
|
-
readonly device: string;
|
|
584
|
-
readonly instruction: string | null;
|
|
585
|
-
constructor(options?: InstructorProviderConfig);
|
|
586
|
-
static name(): string;
|
|
587
|
-
}
|
|
588
|
-
export declare class InstructorProvider extends BaseEmbeddingsProvider {
|
|
589
|
-
readonly provider = "instructor";
|
|
590
|
-
constructor(options?: InstructorProviderConfig);
|
|
591
|
-
}
|
|
592
|
-
export declare class JinaEmbeddingFunction {
|
|
593
|
-
readonly api_key: string | null;
|
|
594
|
-
readonly model_name: string;
|
|
595
|
-
readonly api_url: string;
|
|
596
|
-
constructor(options?: JinaProviderConfig & {
|
|
597
|
-
api_url?: string;
|
|
598
|
-
});
|
|
599
|
-
call(input: Embeddable): Promise<Embeddings>;
|
|
600
|
-
__call__(input: Embeddable): Promise<Embeddings>;
|
|
601
|
-
asCallable(): TypedEmbeddingFunction;
|
|
602
|
-
private requestHeaders;
|
|
603
|
-
}
|
|
604
|
-
export declare class JinaProvider extends BaseEmbeddingsProvider {
|
|
605
|
-
readonly provider = "jina";
|
|
606
|
-
constructor(options?: JinaProviderConfig);
|
|
607
|
-
}
|
|
608
|
-
export declare class OllamaEmbeddingFunction {
|
|
609
|
-
readonly url: string;
|
|
610
|
-
readonly model_name: string;
|
|
611
|
-
constructor(options: OllamaProviderConfig & {
|
|
612
|
-
url: string;
|
|
613
|
-
model_name: string;
|
|
614
|
-
});
|
|
615
|
-
call(input: Embeddable): Promise<Embeddings>;
|
|
616
|
-
__call__(input: Embeddable): Promise<Embeddings>;
|
|
617
|
-
asCallable(): TypedEmbeddingFunction;
|
|
618
|
-
private embedSingle;
|
|
619
|
-
}
|
|
620
|
-
export declare class OllamaProvider extends BaseEmbeddingsProvider {
|
|
621
|
-
readonly provider = "ollama";
|
|
622
|
-
constructor(options?: OllamaProviderConfig);
|
|
623
|
-
}
|
|
624
|
-
export declare class ONNXMiniLM_L6_V2 extends RuntimeEmbeddingFunction {
|
|
625
|
-
readonly preferred_providers: readonly string[] | null;
|
|
626
|
-
constructor(options?: ONNXProviderConfig);
|
|
627
|
-
static name(): string;
|
|
628
|
-
}
|
|
629
|
-
export declare class ONNXProvider extends BaseEmbeddingsProvider {
|
|
630
|
-
readonly provider = "onnx";
|
|
631
|
-
constructor(options?: ONNXProviderConfig);
|
|
632
|
-
}
|
|
633
|
-
export declare class OpenAIProvider extends BaseEmbeddingsProvider {
|
|
634
|
-
readonly provider = "openai";
|
|
635
|
-
constructor(options?: OpenAIProviderConfig);
|
|
636
|
-
}
|
|
637
|
-
export declare class OpenCLIPEmbeddingFunction extends RuntimeEmbeddingFunction {
|
|
638
|
-
readonly model_name: string;
|
|
639
|
-
readonly checkpoint: string;
|
|
640
|
-
readonly device: string | null;
|
|
641
|
-
constructor(options?: OpenCLIPProviderConfig);
|
|
642
|
-
static name(): string;
|
|
643
|
-
}
|
|
644
|
-
export declare class OpenCLIPProvider extends BaseEmbeddingsProvider {
|
|
645
|
-
readonly provider = "openclip";
|
|
646
|
-
constructor(options?: OpenCLIPProviderConfig);
|
|
647
|
-
}
|
|
648
|
-
export declare class RoboflowEmbeddingFunction {
|
|
649
|
-
readonly api_key: string | null;
|
|
650
|
-
readonly api_url: string;
|
|
651
|
-
constructor(options?: RoboflowProviderConfig);
|
|
652
|
-
static name(): string;
|
|
653
|
-
call(input: Embeddable): Promise<Embeddings>;
|
|
654
|
-
__call__(input: Embeddable): Promise<Embeddings>;
|
|
655
|
-
asCallable(): TypedEmbeddingFunction;
|
|
656
|
-
private endpointUrl;
|
|
657
|
-
}
|
|
658
|
-
export declare class RoboflowProvider extends BaseEmbeddingsProvider {
|
|
659
|
-
readonly provider = "roboflow";
|
|
660
|
-
constructor(options?: RoboflowProviderConfig);
|
|
661
|
-
}
|
|
662
|
-
export declare class SentenceTransformerEmbeddingFunction extends RuntimeEmbeddingFunction {
|
|
663
|
-
readonly model_name: string;
|
|
664
|
-
readonly device: string;
|
|
665
|
-
readonly normalize_embeddings: boolean;
|
|
666
|
-
constructor(options?: SentenceTransformerProviderConfig);
|
|
667
|
-
static name(): string;
|
|
668
|
-
}
|
|
669
|
-
export declare class SentenceTransformerProvider extends BaseEmbeddingsProvider {
|
|
670
|
-
readonly provider = "sentence-transformer";
|
|
671
|
-
constructor(options?: SentenceTransformerProviderConfig);
|
|
672
|
-
}
|
|
673
|
-
export declare class Text2VecEmbeddingFunction extends RuntimeEmbeddingFunction {
|
|
674
|
-
readonly model_name: string;
|
|
675
|
-
constructor(options?: Text2VecProviderConfig);
|
|
676
|
-
static name(): string;
|
|
677
|
-
}
|
|
678
|
-
export declare class Text2VecProvider extends BaseEmbeddingsProvider {
|
|
679
|
-
readonly provider = "text2vec";
|
|
680
|
-
constructor(options?: Text2VecProviderConfig);
|
|
681
|
-
}
|
|
682
|
-
export declare class VoyageAIEmbeddingFunction {
|
|
683
|
-
readonly api_key: string | null;
|
|
684
|
-
readonly model: string;
|
|
685
|
-
readonly input_type: string | null;
|
|
686
|
-
readonly truncation: boolean;
|
|
687
|
-
readonly output_dtype: string | null;
|
|
688
|
-
readonly output_dimension: number | null;
|
|
689
|
-
readonly max_retries: number;
|
|
690
|
-
readonly timeout: number | null;
|
|
691
|
-
readonly api_url: string;
|
|
692
|
-
constructor(options?: VoyageAIProviderConfig & {
|
|
693
|
-
api_url?: string;
|
|
694
|
-
});
|
|
695
|
-
static name(): string;
|
|
696
|
-
call(input: Embeddable): Promise<Embeddings>;
|
|
697
|
-
__call__(input: Embeddable): Promise<Embeddings>;
|
|
698
|
-
asCallable(): TypedEmbeddingFunction;
|
|
699
|
-
private requestHeaders;
|
|
700
|
-
private requestBody;
|
|
701
|
-
}
|
|
702
|
-
export declare class VoyageAIProvider extends BaseEmbeddingsProvider {
|
|
703
|
-
readonly provider = "voyageai";
|
|
704
|
-
constructor(options?: VoyageAIProviderConfig);
|
|
705
|
-
}
|
|
706
|
-
export declare const ChromaFactoryModule: Readonly<{
|
|
707
|
-
kind: "ChromaFactoryModule";
|
|
708
|
-
}>;
|
|
709
|
-
export declare const QdrantFactoryModule: Readonly<{
|
|
710
|
-
kind: "QdrantFactoryModule";
|
|
711
|
-
}>;
|
|
712
|
-
export declare const PROVIDER_PATHS: Readonly<Record<AllowedEmbeddingProvider, string>>;
|
|
713
|
-
export type EmbeddingProviderBuilder<TSpec extends ProviderSpec = ProviderSpec> = (spec: TSpec) => TypedEmbeddingFunction;
|
|
714
|
-
export type SearchResult = {
|
|
715
|
-
id: string;
|
|
716
|
-
content: string;
|
|
717
|
-
metadata?: Record<string, unknown>;
|
|
718
|
-
score?: number;
|
|
719
|
-
};
|
|
720
|
-
export type SearchResultOptions = SearchResult;
|
|
721
|
-
export declare const SearchResult: {
|
|
722
|
-
new (options: SearchResultOptions): {
|
|
723
|
-
readonly id: string;
|
|
724
|
-
readonly content: string;
|
|
725
|
-
readonly metadata: Record<string, unknown>;
|
|
726
|
-
readonly score: number;
|
|
727
|
-
};
|
|
728
|
-
};
|
|
729
|
-
export type BaseCollectionParams = {
|
|
730
|
-
collectionName?: string;
|
|
731
|
-
collection_name?: string;
|
|
732
|
-
metadata?: Record<string, unknown>;
|
|
733
|
-
[key: string]: unknown;
|
|
734
|
-
};
|
|
735
|
-
export declare const BaseCollectionParams = "BaseCollectionParams";
|
|
736
|
-
export type BaseCollectionAddParams = BaseCollectionParams & {
|
|
737
|
-
documents: readonly BaseRecord[];
|
|
738
|
-
batchSize?: number;
|
|
739
|
-
batch_size?: number;
|
|
740
|
-
};
|
|
741
|
-
export declare const BaseCollectionAddParams = "BaseCollectionAddParams";
|
|
742
|
-
export type BaseCollectionSearchParams = BaseCollectionParams & {
|
|
743
|
-
query: string;
|
|
744
|
-
limit?: number;
|
|
745
|
-
metadataFilter?: Record<string, unknown> | null;
|
|
746
|
-
metadata_filter?: Record<string, unknown> | null;
|
|
747
|
-
scoreThreshold?: number | null;
|
|
748
|
-
score_threshold?: number | null;
|
|
749
|
-
where?: Record<string, unknown> | null;
|
|
750
|
-
where_document?: unknown;
|
|
751
|
-
include?: unknown;
|
|
752
|
-
};
|
|
753
|
-
export declare const BaseCollectionSearchParams = "BaseCollectionSearchParams";
|
|
754
|
-
export type RagProvider = "chromadb" | "qdrant";
|
|
755
|
-
export type BaseRagConfigOptions = {
|
|
756
|
-
embeddingFunction?: EmbeddingFunction | null;
|
|
757
|
-
embedding_function?: EmbeddingFunction | null;
|
|
758
|
-
limit?: number;
|
|
759
|
-
scoreThreshold?: number;
|
|
760
|
-
score_threshold?: number;
|
|
761
|
-
batchSize?: number;
|
|
762
|
-
batch_size?: number;
|
|
763
|
-
};
|
|
764
|
-
export declare class BaseRagConfig {
|
|
765
|
-
readonly provider: RagProvider;
|
|
766
|
-
readonly embeddingFunction: EmbeddingFunction;
|
|
767
|
-
readonly embedding_function: EmbeddingFunction;
|
|
768
|
-
readonly limit: number;
|
|
769
|
-
readonly scoreThreshold: number;
|
|
770
|
-
readonly score_threshold: number;
|
|
771
|
-
readonly batchSize: number;
|
|
772
|
-
readonly batch_size: number;
|
|
773
|
-
protected constructor(provider: RagProvider, options?: BaseRagConfigOptions);
|
|
774
|
-
}
|
|
775
|
-
export type MissingProviderName = "chromadb" | "qdrant" | "__missing__";
|
|
776
|
-
export declare class _MissingProvider {
|
|
777
|
-
readonly provider: MissingProviderName;
|
|
778
|
-
constructor(options?: {
|
|
779
|
-
provider?: MissingProviderName;
|
|
780
|
-
});
|
|
781
|
-
}
|
|
782
|
-
export type ChromaDBSettings = {
|
|
783
|
-
persistDirectory?: string;
|
|
784
|
-
persist_directory?: string;
|
|
785
|
-
allowReset?: boolean;
|
|
786
|
-
allow_reset?: boolean;
|
|
787
|
-
isPersistent?: boolean;
|
|
788
|
-
is_persistent?: boolean;
|
|
789
|
-
anonymizedTelemetry?: boolean;
|
|
790
|
-
anonymized_telemetry?: boolean;
|
|
791
|
-
[key: string]: unknown;
|
|
792
|
-
};
|
|
793
|
-
export type ChromaDBConfigOptions = BaseRagConfigOptions & {
|
|
794
|
-
tenant?: string;
|
|
795
|
-
database?: string;
|
|
796
|
-
settings?: ChromaDBSettings;
|
|
797
|
-
};
|
|
798
|
-
export declare class ChromaDBConfig extends BaseRagConfig {
|
|
799
|
-
readonly provider: "chromadb";
|
|
800
|
-
readonly tenant: string;
|
|
801
|
-
readonly database: string;
|
|
802
|
-
readonly settings: Required<Pick<ChromaDBSettings, "persistDirectory" | "allowReset" | "isPersistent" | "anonymizedTelemetry">> & ChromaDBSettings;
|
|
803
|
-
constructor(options?: ChromaDBConfigOptions);
|
|
804
|
-
}
|
|
805
|
-
export type QdrantClientParams = {
|
|
806
|
-
location?: string | null;
|
|
807
|
-
url?: string | null;
|
|
808
|
-
port?: number;
|
|
809
|
-
grpcPort?: number;
|
|
810
|
-
grpc_port?: number;
|
|
811
|
-
preferGrpc?: boolean;
|
|
812
|
-
prefer_grpc?: boolean;
|
|
813
|
-
https?: boolean | null;
|
|
814
|
-
apiKey?: string | null;
|
|
815
|
-
api_key?: string | null;
|
|
816
|
-
prefix?: string | null;
|
|
817
|
-
timeout?: number | null;
|
|
818
|
-
host?: string | null;
|
|
819
|
-
path?: string | null;
|
|
820
|
-
forceDisableCheckSameThread?: boolean;
|
|
821
|
-
force_disable_check_same_thread?: boolean;
|
|
822
|
-
grpcOptions?: Record<string, unknown> | null;
|
|
823
|
-
grpc_options?: Record<string, unknown> | null;
|
|
824
|
-
authTokenProvider?: (() => string | Promise<string>) | null;
|
|
825
|
-
auth_token_provider?: (() => string | Promise<string>) | null;
|
|
826
|
-
cloudInference?: boolean;
|
|
827
|
-
cloud_inference?: boolean;
|
|
828
|
-
localInferenceBatchSize?: number | null;
|
|
829
|
-
local_inference_batch_size?: number | null;
|
|
830
|
-
checkCompatibility?: boolean;
|
|
831
|
-
check_compatibility?: boolean;
|
|
832
|
-
};
|
|
833
|
-
export type QdrantConfigOptions = BaseRagConfigOptions & {
|
|
834
|
-
options?: QdrantClientParams;
|
|
835
|
-
vectorsConfig?: unknown;
|
|
836
|
-
vectors_config?: unknown;
|
|
837
|
-
};
|
|
838
|
-
export declare class QdrantConfig extends BaseRagConfig {
|
|
839
|
-
readonly provider: "qdrant";
|
|
840
|
-
readonly options: QdrantClientParams;
|
|
841
|
-
readonly vectorsConfig: unknown;
|
|
842
|
-
readonly vectors_config: unknown;
|
|
843
|
-
constructor(options?: QdrantConfigOptions);
|
|
844
|
-
}
|
|
845
|
-
export declare class MissingChromaDBConfig extends _MissingProvider {
|
|
846
|
-
constructor();
|
|
847
|
-
}
|
|
848
|
-
export declare class MissingQdrantConfig extends _MissingProvider {
|
|
849
|
-
constructor();
|
|
850
|
-
}
|
|
851
|
-
export type RagConfigType = ChromaDBConfig | QdrantConfig;
|
|
852
|
-
export declare const RagConfigType = "RagConfigType";
|
|
853
|
-
export type RagClient = {
|
|
854
|
-
get_or_create_collection?: (params: Record<string, unknown>) => unknown;
|
|
855
|
-
aget_or_create_collection?: (params: Record<string, unknown>) => Promise<unknown>;
|
|
856
|
-
add_documents?: (params: {
|
|
857
|
-
collection_name: string;
|
|
858
|
-
documents: readonly BaseRecord[];
|
|
859
|
-
}) => unknown;
|
|
860
|
-
aadd_documents?: (params: {
|
|
861
|
-
collection_name: string;
|
|
862
|
-
documents: readonly BaseRecord[];
|
|
863
|
-
}) => Promise<unknown>;
|
|
864
|
-
delete_collection?: (params: Record<string, unknown>) => unknown;
|
|
865
|
-
adelete_collection?: (params: Record<string, unknown>) => Promise<unknown>;
|
|
866
|
-
search?: (...args: never[]) => unknown;
|
|
867
|
-
asearch?: (params: BaseCollectionSearchParams) => Promise<unknown>;
|
|
868
|
-
add?: (collectionName: string, records: readonly BaseRecord[]) => unknown;
|
|
869
|
-
deleteCollection?: (...args: never[]) => unknown;
|
|
870
|
-
reset?: () => unknown;
|
|
871
|
-
};
|
|
872
|
-
export type RagClientFactory<TConfig extends RagConfigType = RagConfigType> = (config: TConfig) => RagClient;
|
|
873
|
-
type SimpleEmbeddingFunction = (...args: never[]) => unknown;
|
|
874
|
-
export declare function defaultRagEmbeddingFunction(input: unknown): Embedding | Embeddings;
|
|
875
|
-
export declare const default_rag_embedding_function: typeof defaultRagEmbeddingFunction;
|
|
876
|
-
export declare class ClientMethodMismatchError extends TypeError {
|
|
877
|
-
constructor(methodName: string, expectedClient: string, altMethod: string, altClient: string);
|
|
878
|
-
}
|
|
879
|
-
export declare class ChromaDBClient {
|
|
880
|
-
readonly client: Record<string, unknown>;
|
|
881
|
-
readonly embeddingFunction: SimpleEmbeddingFunction;
|
|
882
|
-
readonly embedding_function: SimpleEmbeddingFunction;
|
|
883
|
-
readonly defaultLimit: number;
|
|
884
|
-
readonly default_limit: number;
|
|
885
|
-
readonly defaultScoreThreshold: number;
|
|
886
|
-
readonly default_score_threshold: number;
|
|
887
|
-
readonly defaultBatchSize: number;
|
|
888
|
-
readonly default_batch_size: number;
|
|
889
|
-
private readonly lockName;
|
|
890
|
-
private readonly lock_name;
|
|
891
|
-
constructor(client: unknown, embeddingFunction?: SimpleEmbeddingFunction, defaultLimit?: number, defaultScoreThreshold?: number, defaultBatchSize?: number, lockName?: string);
|
|
892
|
-
_locked<T>(fn: () => T): T;
|
|
893
|
-
_alocked<T>(fn: () => T | Promise<T>): Promise<T>;
|
|
894
|
-
create_collection(params: BaseCollectionParams): void;
|
|
895
|
-
createCollection(params: BaseCollectionParams): void;
|
|
896
|
-
acreate_collection(params: BaseCollectionParams): Promise<void>;
|
|
897
|
-
get_or_create_collection(params: BaseCollectionParams): unknown;
|
|
898
|
-
getOrCreateCollection(params: BaseCollectionParams): unknown;
|
|
899
|
-
aget_or_create_collection(params: BaseCollectionParams): Promise<unknown>;
|
|
900
|
-
add_documents(params: BaseCollectionAddParams): void;
|
|
901
|
-
addDocuments(params: BaseCollectionAddParams): void;
|
|
902
|
-
aadd_documents(params: BaseCollectionAddParams): Promise<void>;
|
|
903
|
-
search(params: BaseCollectionSearchParams): SearchResult[];
|
|
904
|
-
asearch(params: BaseCollectionSearchParams): Promise<SearchResult[]>;
|
|
905
|
-
delete_collection(params: BaseCollectionParams): void;
|
|
906
|
-
deleteCollection(params: BaseCollectionParams): void;
|
|
907
|
-
adelete_collection(params: BaseCollectionParams): Promise<void>;
|
|
908
|
-
reset(): void;
|
|
909
|
-
areset(): Promise<void>;
|
|
910
|
-
private callClient;
|
|
911
|
-
private callClientAsync;
|
|
912
|
-
private ensureSyncClient;
|
|
913
|
-
private ensureAsyncClient;
|
|
914
|
-
private chromaCollectionPayload;
|
|
915
|
-
}
|
|
916
|
-
export declare class QdrantClient {
|
|
917
|
-
readonly client: Record<string, unknown>;
|
|
918
|
-
readonly embeddingFunction: SimpleEmbeddingFunction;
|
|
919
|
-
readonly embedding_function: SimpleEmbeddingFunction;
|
|
920
|
-
readonly defaultLimit: number;
|
|
921
|
-
readonly default_limit: number;
|
|
922
|
-
readonly defaultScoreThreshold: number;
|
|
923
|
-
readonly default_score_threshold: number;
|
|
924
|
-
readonly defaultBatchSize: number;
|
|
925
|
-
readonly default_batch_size: number;
|
|
926
|
-
constructor(client: unknown, embeddingFunction?: SimpleEmbeddingFunction, defaultLimit?: number, defaultScoreThreshold?: number, defaultBatchSize?: number);
|
|
927
|
-
createCollection(params?: BaseCollectionParams): void;
|
|
928
|
-
create_collection(params?: BaseCollectionParams): void;
|
|
929
|
-
acreate_collection(params?: BaseCollectionParams): Promise<void>;
|
|
930
|
-
get_or_create_collection(params?: BaseCollectionParams): unknown;
|
|
931
|
-
getOrCreateCollection(params?: BaseCollectionParams): unknown;
|
|
932
|
-
aget_or_create_collection(params?: BaseCollectionParams): Promise<unknown>;
|
|
933
|
-
add_documents(params: BaseCollectionAddParams): void;
|
|
934
|
-
addDocuments(params: BaseCollectionAddParams): void;
|
|
935
|
-
aadd_documents(params: BaseCollectionAddParams): Promise<void>;
|
|
936
|
-
search(params: BaseCollectionSearchParams): SearchResult[];
|
|
937
|
-
asearch(params: BaseCollectionSearchParams): Promise<SearchResult[]>;
|
|
938
|
-
delete_collection(params: BaseCollectionParams): void;
|
|
939
|
-
deleteCollection(params: BaseCollectionParams): void;
|
|
940
|
-
adelete_collection(params: BaseCollectionParams): Promise<void>;
|
|
941
|
-
reset(): void;
|
|
942
|
-
areset(): Promise<void>;
|
|
943
|
-
private ensureSyncClient;
|
|
944
|
-
private ensureAsyncClient;
|
|
945
|
-
}
|
|
946
|
-
export declare class RagError extends Error {
|
|
947
|
-
constructor(message: string);
|
|
948
|
-
}
|
|
949
|
-
export declare function _sanitize_collection_name(name: string | null | undefined, max_collection_length?: number): string;
|
|
950
|
-
export declare function _is_ipv4_pattern(name: string): boolean;
|
|
951
|
-
export declare function _prepare_documents_for_chromadb(documents: readonly BaseRecord[]): PreparedDocuments;
|
|
952
|
-
export declare function _create_batch_slice(prepared: PreparedDocuments, start_index: number, batch_size: number): [string[], string[], Array<Record<string, string | number | boolean>> | null];
|
|
953
|
-
export declare function _extract_search_params(kwargs: BaseCollectionSearchParams): {
|
|
954
|
-
collection_name: string;
|
|
955
|
-
query: string;
|
|
956
|
-
limit: number;
|
|
957
|
-
metadata_filter: Record<string, unknown> | null;
|
|
958
|
-
score_threshold: number | null;
|
|
959
|
-
where: Record<string, unknown> | null;
|
|
960
|
-
where_document: unknown;
|
|
961
|
-
include: unknown;
|
|
962
|
-
};
|
|
963
|
-
export declare function _convert_distance_to_score(distance: number, distance_metric: "l2" | "cosine" | "ip"): number;
|
|
964
|
-
export declare function _convert_chromadb_results_to_search_results(results: unknown, include?: readonly string[] | null, distance_metric?: "l2" | "cosine" | "ip", score_threshold?: number | null): SearchResult[];
|
|
965
|
-
export declare function _process_query_results(collection: {
|
|
966
|
-
metadata?: Record<string, unknown> | null;
|
|
967
|
-
}, results: unknown, params: {
|
|
968
|
-
include?: readonly string[] | null;
|
|
969
|
-
score_threshold?: number | null;
|
|
970
|
-
}): SearchResult[];
|
|
971
|
-
export declare function _ensure_list_embedding(embedding: QueryEmbedding | {
|
|
972
|
-
tolist?: () => unknown;
|
|
973
|
-
}): number[];
|
|
974
|
-
export declare function _is_sync_client(client: unknown): boolean;
|
|
975
|
-
export declare function _is_async_client(client: unknown): boolean;
|
|
976
|
-
export declare function _is_async_embedding_function(func: unknown): boolean;
|
|
977
|
-
export declare function _get_collection_params(kwargs: Record<string, unknown>): Record<string, unknown>;
|
|
978
|
-
export declare function _prepare_search_params(collection_name: string, query_embedding: QueryEmbedding | {
|
|
979
|
-
tolist?: () => unknown;
|
|
980
|
-
}, limit: number, score_threshold?: number | null, metadata_filter?: Record<string, unknown> | null): Record<string, unknown>;
|
|
981
|
-
export declare function _normalize_qdrant_score(score: number): number;
|
|
982
|
-
export declare function _process_search_results(response: unknown): SearchResult[];
|
|
983
|
-
export declare function _create_point_from_document(doc: BaseRecord, embedding: QueryEmbedding | {
|
|
984
|
-
tolist?: () => unknown;
|
|
985
|
-
}): {
|
|
986
|
-
id: string;
|
|
987
|
-
vector: number[];
|
|
988
|
-
payload: Record<string, unknown>;
|
|
989
|
-
};
|
|
990
|
-
export declare function registerRagClientFactory<TConfig extends RagConfigType>(provider: TConfig["provider"], factory: RagClientFactory<TConfig>): void;
|
|
991
|
-
export declare const register_rag_client_factory: typeof registerRagClientFactory;
|
|
992
|
-
export declare function unregisterRagClientFactory(provider: RagProvider): void;
|
|
993
|
-
export declare const unregister_rag_client_factory: typeof unregisterRagClientFactory;
|
|
994
|
-
export declare function clearRagClientFactories(): void;
|
|
995
|
-
export declare const clear_rag_client_factories: typeof clearRagClientFactories;
|
|
996
|
-
export declare function createRagClient(config: RagConfigType | ({
|
|
997
|
-
provider: RagProvider;
|
|
998
|
-
} & Record<string, unknown>)): RagClient;
|
|
999
|
-
export declare const create_client: typeof createRagClient;
|
|
1000
|
-
export declare const createClient: typeof createRagClient;
|
|
1001
|
-
export declare function setRagConfig(config: RagConfigType): void;
|
|
1002
|
-
export declare const set_rag_config: typeof setRagConfig;
|
|
1003
|
-
export declare function getRagConfig(): RagConfigType;
|
|
1004
|
-
export declare const get_rag_config: typeof getRagConfig;
|
|
1005
|
-
export declare function getRagClient(): RagClient;
|
|
1006
|
-
export declare const get_rag_client: typeof getRagClient;
|
|
1007
|
-
export declare function clearRagConfig(): void;
|
|
1008
|
-
export declare const clear_rag_config: typeof clearRagConfig;
|
|
1009
|
-
export declare function normalizeRagConfig(config: RagConfigType | ({
|
|
1010
|
-
provider: string;
|
|
1011
|
-
} & Record<string, unknown>)): RagConfigType;
|
|
1012
|
-
export declare const normalize_rag_config: typeof normalizeRagConfig;
|
|
1013
|
-
export type BaseRAGStorageOptions = {
|
|
1014
|
-
type: string;
|
|
1015
|
-
allowReset?: boolean;
|
|
1016
|
-
allow_reset?: boolean;
|
|
1017
|
-
embedderConfig?: unknown;
|
|
1018
|
-
embedder_config?: unknown;
|
|
1019
|
-
crew?: {
|
|
1020
|
-
agents?: readonly {
|
|
1021
|
-
role: string;
|
|
1022
|
-
}[];
|
|
1023
|
-
} | null;
|
|
1024
|
-
};
|
|
1025
|
-
export declare abstract class BaseRAGStorage {
|
|
1026
|
-
readonly type: string;
|
|
1027
|
-
readonly allowReset: boolean;
|
|
1028
|
-
readonly allow_reset: boolean;
|
|
1029
|
-
readonly embedderConfig: unknown;
|
|
1030
|
-
readonly embedder_config: unknown;
|
|
1031
|
-
readonly crew: {
|
|
1032
|
-
agents?: readonly {
|
|
1033
|
-
role: string;
|
|
1034
|
-
}[];
|
|
1035
|
-
} | null;
|
|
1036
|
-
readonly agents: string;
|
|
1037
|
-
constructor(options: BaseRAGStorageOptions);
|
|
1038
|
-
protected initializeAgents(): string;
|
|
1039
|
-
_initialize_agents(): string;
|
|
1040
|
-
protected abstract sanitizeRole(role: string): string;
|
|
1041
|
-
_sanitize_role(role: string): string;
|
|
1042
|
-
abstract save(value: unknown, metadata: Record<string, unknown>): unknown;
|
|
1043
|
-
abstract search(query: string, limit?: number, filter?: Record<string, unknown> | null, scoreThreshold?: number): unknown;
|
|
1044
|
-
abstract reset(): unknown;
|
|
1045
|
-
}
|
|
1046
|
-
export declare function normalizeBaseRecord(record: BaseRecord): Required<Pick<BaseRecord, "content">> & {
|
|
1047
|
-
docId: string;
|
|
1048
|
-
metadata: RagMetadata | readonly RagMetadata[] | null;
|
|
1049
|
-
};
|
|
1050
|
-
export declare const normalize_base_record: typeof normalizeBaseRecord;
|
|
1051
|
-
export declare function createContentId(content: string): string;
|
|
1052
|
-
export declare const create_content_id: typeof createContentId;
|
|
1053
|
-
export declare function normalizeEmbeddings(target: Embedding | Embeddings): Embeddings;
|
|
1054
|
-
export declare const normalize_embeddings: typeof normalizeEmbeddings;
|
|
1055
|
-
export declare function maybeCastOneToMany<T>(target: T | readonly T[] | null | undefined): readonly T[] | null;
|
|
1056
|
-
export declare const maybe_cast_one_to_many: typeof maybeCastOneToMany;
|
|
1057
|
-
export declare function validateEmbeddings(embeddings: Embeddings): Embeddings;
|
|
1058
|
-
export declare const validate_embeddings: typeof validateEmbeddings;
|
|
1059
|
-
export declare function wrapped_call<TInput>(embeddingFunction: (input: TInput) => Embedding | Embeddings | null | undefined, input: TInput): Embeddings;
|
|
1060
|
-
export declare function registerEmbeddingProviderBuilder<TSpec extends ProviderSpec>(provider: TSpec["provider"], builder: EmbeddingProviderBuilder<TSpec>): void;
|
|
1061
|
-
export declare const register_embedding_provider_builder: typeof registerEmbeddingProviderBuilder;
|
|
1062
|
-
export declare function unregisterEmbeddingProviderBuilder(provider: AllowedEmbeddingProvider): void;
|
|
1063
|
-
export declare const unregister_embedding_provider_builder: typeof unregisterEmbeddingProviderBuilder;
|
|
1064
|
-
export declare function clearEmbeddingProviderBuilders(): void;
|
|
1065
|
-
export declare const clear_embedding_provider_builders: typeof clearEmbeddingProviderBuilders;
|
|
1066
|
-
export declare function buildEmbedderFromProvider(provider: BaseEmbeddingsProvider): TypedEmbeddingFunction;
|
|
1067
|
-
export declare const build_embedder_from_provider: typeof buildEmbedderFromProvider;
|
|
1068
|
-
export declare function buildEmbedderFromDict(spec: ProviderSpec): TypedEmbeddingFunction;
|
|
1069
|
-
export declare const build_embedder_from_dict: typeof buildEmbedderFromDict;
|
|
1070
|
-
export declare function buildEmbedder(spec: EmbedderConfig): TypedEmbeddingFunction;
|
|
1071
|
-
export declare const build_embedder: typeof buildEmbedder;
|
|
1072
|
-
export declare const getEmbeddingFunction: typeof buildEmbedder;
|
|
1073
|
-
export declare const get_embedding_function: typeof buildEmbedder;
|
|
1074
|
-
export {};
|