@xano-sdk/vector 1.0.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/AGENTS.md +68 -0
- package/LICENSE +21 -0
- package/README.md +210 -0
- package/dist/index.d.ts +1189 -0
- package/dist/index.js +1429 -0
- package/llms.txt +62 -0
- package/package.json +85 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1189 @@
|
|
|
1
|
+
import * as _xano_sdk from '@xano/sdk';
|
|
2
|
+
import { TableDef, InferRow, FunctionDef, InputDescriptor, ToolDef, Xano } from '@xano/sdk';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options and validator for `@xano-sdk/vector`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** Supported text chunking strategies. */
|
|
9
|
+
declare const CHUNK_STRATEGIES: readonly ["fixed", "paragraph", "sentence", "markdown", "custom"];
|
|
10
|
+
type ChunkStrategy = (typeof CHUNK_STRATEGIES)[number];
|
|
11
|
+
/** Document indexing lifecycle status. */
|
|
12
|
+
declare const DOCUMENT_STATUSES: readonly ["pending", "indexing", "indexed", "failed"];
|
|
13
|
+
type DocumentStatus = (typeof DOCUMENT_STATUSES)[number];
|
|
14
|
+
/** Supported citation formatting styles for AI agents. */
|
|
15
|
+
type CitationFormat = "markdown" | "numeric" | "none";
|
|
16
|
+
/** Supported auth table references. */
|
|
17
|
+
type VectorAuthTable = TableDef | string;
|
|
18
|
+
/** Multimodal Google Gemini Embeddings 2 operates at 768 dimensions using MRL. */
|
|
19
|
+
declare const GEMINI_EMBEDDING_DIMENSIONS = 768;
|
|
20
|
+
/** Default embedding model for Gemini Embeddings 2. */
|
|
21
|
+
declare const DEFAULT_GEMINI_MODEL = "gemini-embedding-2";
|
|
22
|
+
/** Default environment variable name for the Google API key. */
|
|
23
|
+
declare const DEFAULT_API_KEY_ENV = "GEMINI_API_KEY";
|
|
24
|
+
/** Default chunking character size. */
|
|
25
|
+
declare const DEFAULT_CHUNK_SIZE = 500;
|
|
26
|
+
/** Default chunking character overlap. */
|
|
27
|
+
declare const DEFAULT_CHUNK_OVERLAP = 50;
|
|
28
|
+
/** Default top-k vector search limit. */
|
|
29
|
+
declare const DEFAULT_SEARCH_LIMIT = 10;
|
|
30
|
+
/** Default similarity threshold (0.0 to 1.0). */
|
|
31
|
+
declare const DEFAULT_SEARCH_THRESHOLD = 0;
|
|
32
|
+
/** Default chunking strategy. */
|
|
33
|
+
declare const DEFAULT_STRATEGY: ChunkStrategy;
|
|
34
|
+
/** Custom naming overrides for generated defs. */
|
|
35
|
+
interface VectorNames {
|
|
36
|
+
document?: string;
|
|
37
|
+
chunk?: string;
|
|
38
|
+
embedFn?: string;
|
|
39
|
+
chunkFn?: string;
|
|
40
|
+
ingestFn?: string;
|
|
41
|
+
searchFn?: string;
|
|
42
|
+
searchTool?: string;
|
|
43
|
+
apiGroup?: string;
|
|
44
|
+
}
|
|
45
|
+
declare const DEFAULT_NAMES: Required<VectorNames>;
|
|
46
|
+
/** User-facing configuration options for `createVector` and `registerVector`. */
|
|
47
|
+
interface VectorOptions {
|
|
48
|
+
authTable?: TableDef | string;
|
|
49
|
+
authenticated?: boolean;
|
|
50
|
+
userIdType?: "int" | "uuid";
|
|
51
|
+
model?: string;
|
|
52
|
+
apiKeyEnv?: string;
|
|
53
|
+
defaultStrategy?: ChunkStrategy;
|
|
54
|
+
defaultChunkSize?: number;
|
|
55
|
+
defaultChunkOverlap?: number;
|
|
56
|
+
searchLimit?: number;
|
|
57
|
+
searchThreshold?: number;
|
|
58
|
+
taskTypeDocument?: string;
|
|
59
|
+
taskTypeQuery?: string;
|
|
60
|
+
citationFormat?: CitationFormat;
|
|
61
|
+
routePrefix?: string;
|
|
62
|
+
canonical?: string;
|
|
63
|
+
names?: VectorNames;
|
|
64
|
+
tags?: string[];
|
|
65
|
+
}
|
|
66
|
+
/** Fully resolved, validated options ready for internal consumption. */
|
|
67
|
+
interface ResolvedOptions {
|
|
68
|
+
authTable: TableDef | string | undefined;
|
|
69
|
+
authenticated: boolean;
|
|
70
|
+
userIdType: "int" | "uuid";
|
|
71
|
+
model: string;
|
|
72
|
+
apiKeyEnv: string;
|
|
73
|
+
dimensions: number;
|
|
74
|
+
defaultStrategy: ChunkStrategy;
|
|
75
|
+
defaultChunkSize: number;
|
|
76
|
+
defaultChunkOverlap: number;
|
|
77
|
+
searchLimit: number;
|
|
78
|
+
searchThreshold: number;
|
|
79
|
+
taskTypeDocument: string;
|
|
80
|
+
taskTypeQuery: string;
|
|
81
|
+
citationFormat: CitationFormat;
|
|
82
|
+
routePrefix: string;
|
|
83
|
+
canonical: string | undefined;
|
|
84
|
+
names: Required<VectorNames>;
|
|
85
|
+
tags: string[];
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Validates and resolves `VectorOptions` into a complete `ResolvedOptions`.
|
|
89
|
+
*/
|
|
90
|
+
declare function resolveOptions(opts?: VectorOptions): ResolvedOptions;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The `document` table — stores uploaded documents, media assets, and indexing status.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/** Build the `document` def for the given resolved options. */
|
|
97
|
+
declare function documentTable(opts: ResolvedOptions): TableDef<string, {
|
|
98
|
+
[x: string]: unknown;
|
|
99
|
+
}, never>;
|
|
100
|
+
/** The `document` def type. */
|
|
101
|
+
type DocumentTable = ReturnType<typeof documentTable>;
|
|
102
|
+
/** A `document` row. */
|
|
103
|
+
type DocumentRow = InferRow<ReturnType<typeof documentTable>>;
|
|
104
|
+
/** Public fields returned for a document. */
|
|
105
|
+
declare const PUBLIC_DOCUMENT_FIELDS: readonly ["id", "created_at", "title", "content", "media_data", "mime_type", "metadata", "status", "chunk_count", "strategy", "chunk_size", "chunk_overlap", "error_message"];
|
|
106
|
+
interface PublicDocument {
|
|
107
|
+
id: number;
|
|
108
|
+
created_at: number;
|
|
109
|
+
title: string;
|
|
110
|
+
content: string;
|
|
111
|
+
media_data?: string;
|
|
112
|
+
mime_type: string;
|
|
113
|
+
metadata: Record<string, unknown>;
|
|
114
|
+
status: string;
|
|
115
|
+
chunk_count: number;
|
|
116
|
+
strategy: string;
|
|
117
|
+
chunk_size: number;
|
|
118
|
+
chunk_overlap: number;
|
|
119
|
+
error_message?: string;
|
|
120
|
+
user_id?: number | string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Build the `document_chunk` def for the given resolved options and document table. */
|
|
124
|
+
declare function chunkTable(opts: ResolvedOptions, document: DocumentTable): _xano_sdk.TableDef<_xano_sdk.SchemaCols<{
|
|
125
|
+
document_id: _xano_sdk.FieldDescriptor & _xano_sdk.TypeBrand<number, {
|
|
126
|
+
readonly required: true;
|
|
127
|
+
readonly description: "The document this chunk was generated from.";
|
|
128
|
+
}, "int">;
|
|
129
|
+
document_title: _xano_sdk.FieldDescriptor & _xano_sdk.TypeBrand<string, {
|
|
130
|
+
readonly required: false;
|
|
131
|
+
readonly description: "Title of the parent document.";
|
|
132
|
+
}, "text">;
|
|
133
|
+
chunk_index: _xano_sdk.FieldDescriptor & _xano_sdk.TypeBrand<number, {
|
|
134
|
+
readonly required: true;
|
|
135
|
+
readonly description: "0-based sequence index of the chunk within the document.";
|
|
136
|
+
}, "int">;
|
|
137
|
+
content: _xano_sdk.FieldDescriptor & _xano_sdk.TypeBrand<string, {
|
|
138
|
+
readonly required: false;
|
|
139
|
+
readonly description: "The text content or caption of this chunk.";
|
|
140
|
+
}, "text">;
|
|
141
|
+
mime_type: _xano_sdk.FieldDescriptor & _xano_sdk.TypeBrand<string, {
|
|
142
|
+
readonly default: "text/plain";
|
|
143
|
+
readonly description: "MIME type of the chunk content (e.g. text/plain, image/png, audio/mp3).";
|
|
144
|
+
}, "text">;
|
|
145
|
+
embedding: _xano_sdk.FieldDescriptor & _xano_sdk.TypeBrand<number[], {
|
|
146
|
+
readonly description: "Google Gemini 768-dimensional multimodal vector embedding.";
|
|
147
|
+
}, "vector">;
|
|
148
|
+
metadata: _xano_sdk.FieldDescriptor & _xano_sdk.TypeBrand<unknown, {
|
|
149
|
+
readonly description: "Metadata specific to this chunk (e.g. section title, timestamps, bounding box).";
|
|
150
|
+
}, "json">;
|
|
151
|
+
char_count: _xano_sdk.FieldDescriptor & _xano_sdk.TypeBrand<number, {
|
|
152
|
+
readonly default: 0;
|
|
153
|
+
readonly description: "Character length of the text content.";
|
|
154
|
+
}, "int">;
|
|
155
|
+
}>, {
|
|
156
|
+
id: number;
|
|
157
|
+
created_at: number;
|
|
158
|
+
document_id: number;
|
|
159
|
+
document_title: string;
|
|
160
|
+
chunk_index: number;
|
|
161
|
+
content: string;
|
|
162
|
+
mime_type: string;
|
|
163
|
+
embedding: number[] | null;
|
|
164
|
+
metadata: unknown;
|
|
165
|
+
char_count: number;
|
|
166
|
+
}, never>;
|
|
167
|
+
/** The `document_chunk` def type. */
|
|
168
|
+
type ChunkTable = ReturnType<typeof chunkTable>;
|
|
169
|
+
/** A `document_chunk` row. */
|
|
170
|
+
type ChunkRow = InferRow<ReturnType<typeof chunkTable>>;
|
|
171
|
+
/** Public fields returned for a chunk. */
|
|
172
|
+
declare const PUBLIC_CHUNK_FIELDS: readonly ["id", "created_at", "document_id", "document_title", "chunk_index", "content", "mime_type", "metadata", "char_count"];
|
|
173
|
+
interface PublicChunk {
|
|
174
|
+
id: number;
|
|
175
|
+
created_at: number;
|
|
176
|
+
document_id: number;
|
|
177
|
+
document_title?: string;
|
|
178
|
+
chunk_index: number;
|
|
179
|
+
content: string;
|
|
180
|
+
mime_type: string;
|
|
181
|
+
metadata: Record<string, unknown>;
|
|
182
|
+
char_count: number;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* `vector/generate_embedding` — calls Google Gemini Multimodal Embedding 2 API to generate a
|
|
187
|
+
* 768-dimensional multimodal vector embedding for text, image, audio, video, or interleaved inputs.
|
|
188
|
+
*/
|
|
189
|
+
|
|
190
|
+
/** Return type for generateEmbeddingFn. */
|
|
191
|
+
type GenerateEmbeddingFn = FunctionDef<Record<string, InputDescriptor>, {
|
|
192
|
+
embedding: number[];
|
|
193
|
+
dimensions: number;
|
|
194
|
+
}>;
|
|
195
|
+
/** Build the `generateEmbedding` function definition for the given options. */
|
|
196
|
+
declare function generateEmbeddingFn(opts: ResolvedOptions): GenerateEmbeddingFn;
|
|
197
|
+
|
|
198
|
+
/** A single structured chunk item produced by chunking text. */
|
|
199
|
+
interface ChunkItem {
|
|
200
|
+
index: number;
|
|
201
|
+
content: string;
|
|
202
|
+
char_count: number;
|
|
203
|
+
metadata: Record<string, unknown>;
|
|
204
|
+
}
|
|
205
|
+
/** Build the `chunkText` function definition for the given options. */
|
|
206
|
+
declare function chunkTextFn(opts: ResolvedOptions): _xano_sdk.FunctionDef<{
|
|
207
|
+
readonly content: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
208
|
+
readonly required: false;
|
|
209
|
+
readonly description: "The raw text content to segment into chunks.";
|
|
210
|
+
}, "text">;
|
|
211
|
+
readonly strategy: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<"fixed" | "paragraph" | "sentence" | "markdown" | "custom", {
|
|
212
|
+
readonly default: "fixed" | "paragraph" | "sentence" | "markdown" | "custom";
|
|
213
|
+
readonly description: "Chunking algorithm: fixed, paragraph, sentence, markdown, or custom.";
|
|
214
|
+
}, "enum">;
|
|
215
|
+
readonly chunk_size: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
216
|
+
readonly default: number;
|
|
217
|
+
readonly description: "Target maximum character count per chunk.";
|
|
218
|
+
}, "int">;
|
|
219
|
+
readonly chunk_overlap: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
220
|
+
readonly default: number;
|
|
221
|
+
readonly description: "Character overlap preserved between consecutive chunks.";
|
|
222
|
+
}, "int">;
|
|
223
|
+
}, {
|
|
224
|
+
chunks: ChunkItem[];
|
|
225
|
+
count: number;
|
|
226
|
+
}, _xano_sdk.ObjValue<{
|
|
227
|
+
chunks: _xano_sdk.RefValue<"chunks">;
|
|
228
|
+
count: _xano_sdk.TaggedValue & {
|
|
229
|
+
readonly __filtered: true;
|
|
230
|
+
readonly __base?: _xano_sdk.RefValue<"chunks"> | undefined;
|
|
231
|
+
readonly __chain?: [_xano_sdk.FilterXdo<"count">] | undefined;
|
|
232
|
+
};
|
|
233
|
+
}>, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"target_size", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"target_overlap", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"active_strategy", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"raw_text", unknown>, _xano_sdk.Statement]>;
|
|
234
|
+
/** The `chunkText` function def type. */
|
|
235
|
+
type ChunkTextFn = ReturnType<typeof chunkTextFn>;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* `vector/ingest_document` — orchestrates chunking, multimodal embedding generation,
|
|
239
|
+
* and bulk persistence into `document_chunk` and `document` tables.
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
/** Return type for ingestDocumentFn. */
|
|
243
|
+
type IngestDocumentFn = FunctionDef<Record<string, InputDescriptor>, {
|
|
244
|
+
document_id: number;
|
|
245
|
+
status: string;
|
|
246
|
+
chunk_count: number;
|
|
247
|
+
}>;
|
|
248
|
+
/** Build the `ingestDocument` function definition. */
|
|
249
|
+
declare function ingestDocumentFn(opts: ResolvedOptions, document: DocumentTable, chunk: ChunkTable, embedFn: GenerateEmbeddingFn, chunkFn: ChunkTextFn): IngestDocumentFn;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* `vector/search_vectors` — performs cosine similarity vector search over the chunk table
|
|
253
|
+
* using pgvector and Gemini 768-dimensional multimodal embeddings.
|
|
254
|
+
*/
|
|
255
|
+
|
|
256
|
+
/** A single vector search hit item. */
|
|
257
|
+
interface SearchHit {
|
|
258
|
+
id: number;
|
|
259
|
+
document_id: number;
|
|
260
|
+
document_title?: string;
|
|
261
|
+
chunk_index: number;
|
|
262
|
+
content: string;
|
|
263
|
+
mime_type: string;
|
|
264
|
+
metadata: Record<string, unknown>;
|
|
265
|
+
distance: number;
|
|
266
|
+
}
|
|
267
|
+
/** Return type for searchVectorsFn. */
|
|
268
|
+
type SearchVectorsFn = FunctionDef<Record<string, InputDescriptor>, {
|
|
269
|
+
results: SearchHit[];
|
|
270
|
+
count: number;
|
|
271
|
+
}>;
|
|
272
|
+
/** Build the `searchVectors` function definition. */
|
|
273
|
+
declare function searchVectorsFn(opts: ResolvedOptions, chunk: ChunkTable, embedFn: GenerateEmbeddingFn): SearchVectorsFn;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* `vector_search` — AI Agent Tool definition for semantic multimodal vector search.
|
|
277
|
+
*/
|
|
278
|
+
|
|
279
|
+
/** Return type for vectorSearchTool. */
|
|
280
|
+
type VectorSearchTool = ToolDef<Record<string, InputDescriptor>, unknown>;
|
|
281
|
+
/** Build the `vector_search` agent tool definition. */
|
|
282
|
+
declare function vectorSearchTool(opts: ResolvedOptions, searchFn: SearchVectorsFn): VectorSearchTool;
|
|
283
|
+
|
|
284
|
+
/** Build the API group for the vector endpoints. */
|
|
285
|
+
declare function vectorGroup(opts: ResolvedOptions): _xano_sdk.ApiGroupDef;
|
|
286
|
+
/** The `vectorGroup` def type. */
|
|
287
|
+
type VectorGroup = ReturnType<typeof vectorGroup>;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Request and response payload interfaces for the Vector API Group endpoints.
|
|
291
|
+
*/
|
|
292
|
+
|
|
293
|
+
interface CreateDocumentPayload {
|
|
294
|
+
title: string;
|
|
295
|
+
content?: string;
|
|
296
|
+
media_data?: string;
|
|
297
|
+
mime_type?: string;
|
|
298
|
+
metadata?: Record<string, unknown>;
|
|
299
|
+
strategy?: string;
|
|
300
|
+
chunk_size?: number;
|
|
301
|
+
chunk_overlap?: number;
|
|
302
|
+
}
|
|
303
|
+
interface CreateDocumentResult {
|
|
304
|
+
document: PublicDocument;
|
|
305
|
+
chunk_count: number;
|
|
306
|
+
status: string;
|
|
307
|
+
}
|
|
308
|
+
interface ListDocumentsPayload {
|
|
309
|
+
page?: number;
|
|
310
|
+
per_page?: number;
|
|
311
|
+
status?: string;
|
|
312
|
+
}
|
|
313
|
+
interface ListDocumentsResult {
|
|
314
|
+
items: PublicDocument[];
|
|
315
|
+
curPage: number;
|
|
316
|
+
perPage: number;
|
|
317
|
+
itemsReceived: number;
|
|
318
|
+
itemsTotal: number;
|
|
319
|
+
pageTotal: number;
|
|
320
|
+
}
|
|
321
|
+
interface GetDocumentResult {
|
|
322
|
+
document: PublicDocument;
|
|
323
|
+
chunks: PublicChunk[];
|
|
324
|
+
}
|
|
325
|
+
interface DeleteDocumentResult {
|
|
326
|
+
deleted: boolean;
|
|
327
|
+
id: number;
|
|
328
|
+
}
|
|
329
|
+
interface ReindexDocumentPayload {
|
|
330
|
+
strategy?: string;
|
|
331
|
+
chunk_size?: number;
|
|
332
|
+
chunk_overlap?: number;
|
|
333
|
+
}
|
|
334
|
+
interface ReindexDocumentResult {
|
|
335
|
+
document_id: number;
|
|
336
|
+
status: string;
|
|
337
|
+
chunk_count: number;
|
|
338
|
+
}
|
|
339
|
+
interface SearchPayload {
|
|
340
|
+
query?: string;
|
|
341
|
+
query_media_data?: string;
|
|
342
|
+
query_mime_type?: string;
|
|
343
|
+
query_embedding?: number[];
|
|
344
|
+
limit?: number;
|
|
345
|
+
threshold?: number;
|
|
346
|
+
}
|
|
347
|
+
interface SearchResult {
|
|
348
|
+
results: SearchHit[];
|
|
349
|
+
count: number;
|
|
350
|
+
}
|
|
351
|
+
interface EmbedPayload {
|
|
352
|
+
text?: string;
|
|
353
|
+
media_data?: string;
|
|
354
|
+
mime_type?: string;
|
|
355
|
+
model?: string;
|
|
356
|
+
}
|
|
357
|
+
interface EmbedResult {
|
|
358
|
+
embedding: number[];
|
|
359
|
+
dimensions: number;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
declare function documentQueries(opts: ResolvedOptions, group: VectorGroup, document: DocumentTable, chunk: ChunkTable, ingestFn: IngestDocumentFn): {
|
|
363
|
+
create: _xano_sdk.QueryDef<{
|
|
364
|
+
readonly title: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
365
|
+
readonly required: true;
|
|
366
|
+
readonly description: "Title or filename for the document.";
|
|
367
|
+
}, "text">;
|
|
368
|
+
readonly content: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
369
|
+
readonly required: false;
|
|
370
|
+
readonly description: "Raw text content of the document.";
|
|
371
|
+
}, "text">;
|
|
372
|
+
readonly media_data: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
373
|
+
readonly required: false;
|
|
374
|
+
readonly description: "Base64-encoded media data (images, audio, video).";
|
|
375
|
+
}, "text">;
|
|
376
|
+
readonly mime_type: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
377
|
+
readonly default: "text/plain";
|
|
378
|
+
readonly description: "MIME type (e.g. text/markdown, image/png, audio/mp3).";
|
|
379
|
+
}, "text">;
|
|
380
|
+
readonly metadata: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<unknown, {
|
|
381
|
+
readonly required: false;
|
|
382
|
+
readonly description: "Arbitrary structured metadata.";
|
|
383
|
+
}, "json">;
|
|
384
|
+
readonly strategy: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<"fixed" | "paragraph" | "sentence" | "markdown" | "custom", {
|
|
385
|
+
readonly default: "fixed" | "paragraph" | "sentence" | "markdown" | "custom";
|
|
386
|
+
readonly description: "Chunking algorithm for text content.";
|
|
387
|
+
}, "enum">;
|
|
388
|
+
readonly chunk_size: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
389
|
+
readonly default: number;
|
|
390
|
+
readonly description: "Target maximum chunk size in characters.";
|
|
391
|
+
}, "int">;
|
|
392
|
+
readonly chunk_overlap: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
393
|
+
readonly default: number;
|
|
394
|
+
readonly description: "Chunk character overlap.";
|
|
395
|
+
}, "int">;
|
|
396
|
+
}, CreateDocumentResult, _xano_sdk.ObjValue<{
|
|
397
|
+
document: _xano_sdk.RefValue<"final_doc">;
|
|
398
|
+
chunk_count: _xano_sdk.RefValue<"ingest_res.chunk_count">;
|
|
399
|
+
status: _xano_sdk.RefValue<"ingest_res.status">;
|
|
400
|
+
}>, readonly [_xano_sdk.Statement, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"created_doc", {
|
|
401
|
+
[x: string]: unknown;
|
|
402
|
+
}>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"ingest_res", {
|
|
403
|
+
document_id: number;
|
|
404
|
+
status: string;
|
|
405
|
+
chunk_count: number;
|
|
406
|
+
}>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"final_doc", {
|
|
407
|
+
[x: string]: unknown;
|
|
408
|
+
} | null>], `${string}/documents/create`, "POST"> & {
|
|
409
|
+
getPath: (opts?: {
|
|
410
|
+
canonical?: string;
|
|
411
|
+
}) => string;
|
|
412
|
+
toSearchParams: {
|
|
413
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
414
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
415
|
+
};
|
|
416
|
+
} & {
|
|
417
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
418
|
+
};
|
|
419
|
+
createDocument: _xano_sdk.QueryDef<{
|
|
420
|
+
readonly title: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
421
|
+
readonly required: true;
|
|
422
|
+
readonly description: "Title or filename for the document.";
|
|
423
|
+
}, "text">;
|
|
424
|
+
readonly content: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
425
|
+
readonly required: false;
|
|
426
|
+
readonly description: "Raw text content of the document.";
|
|
427
|
+
}, "text">;
|
|
428
|
+
readonly media_data: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
429
|
+
readonly required: false;
|
|
430
|
+
readonly description: "Base64-encoded media data (images, audio, video).";
|
|
431
|
+
}, "text">;
|
|
432
|
+
readonly mime_type: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
433
|
+
readonly default: "text/plain";
|
|
434
|
+
readonly description: "MIME type (e.g. text/markdown, image/png, audio/mp3).";
|
|
435
|
+
}, "text">;
|
|
436
|
+
readonly metadata: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<unknown, {
|
|
437
|
+
readonly required: false;
|
|
438
|
+
readonly description: "Arbitrary structured metadata.";
|
|
439
|
+
}, "json">;
|
|
440
|
+
readonly strategy: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<"fixed" | "paragraph" | "sentence" | "markdown" | "custom", {
|
|
441
|
+
readonly default: "fixed" | "paragraph" | "sentence" | "markdown" | "custom";
|
|
442
|
+
readonly description: "Chunking algorithm for text content.";
|
|
443
|
+
}, "enum">;
|
|
444
|
+
readonly chunk_size: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
445
|
+
readonly default: number;
|
|
446
|
+
readonly description: "Target maximum chunk size in characters.";
|
|
447
|
+
}, "int">;
|
|
448
|
+
readonly chunk_overlap: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
449
|
+
readonly default: number;
|
|
450
|
+
readonly description: "Chunk character overlap.";
|
|
451
|
+
}, "int">;
|
|
452
|
+
}, CreateDocumentResult, _xano_sdk.ObjValue<{
|
|
453
|
+
document: _xano_sdk.RefValue<"final_doc">;
|
|
454
|
+
chunk_count: _xano_sdk.RefValue<"ingest_res.chunk_count">;
|
|
455
|
+
status: _xano_sdk.RefValue<"ingest_res.status">;
|
|
456
|
+
}>, readonly [_xano_sdk.Statement, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"created_doc", {
|
|
457
|
+
[x: string]: unknown;
|
|
458
|
+
}>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"ingest_res", {
|
|
459
|
+
document_id: number;
|
|
460
|
+
status: string;
|
|
461
|
+
chunk_count: number;
|
|
462
|
+
}>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"final_doc", {
|
|
463
|
+
[x: string]: unknown;
|
|
464
|
+
} | null>], `${string}/documents/create`, "POST"> & {
|
|
465
|
+
getPath: (opts?: {
|
|
466
|
+
canonical?: string;
|
|
467
|
+
}) => string;
|
|
468
|
+
toSearchParams: {
|
|
469
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
470
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
471
|
+
};
|
|
472
|
+
} & {
|
|
473
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
474
|
+
};
|
|
475
|
+
list: _xano_sdk.QueryDef<{
|
|
476
|
+
readonly page: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
477
|
+
readonly default: 1;
|
|
478
|
+
readonly description: "Page number (1-based).";
|
|
479
|
+
}, "int">;
|
|
480
|
+
readonly per_page: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
481
|
+
readonly default: 20;
|
|
482
|
+
readonly description: "Number of documents per page.";
|
|
483
|
+
}, "int">;
|
|
484
|
+
}, ListDocumentsResult, _xano_sdk.RefValue<"docs">, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"docs", {
|
|
485
|
+
items: {
|
|
486
|
+
[x: string]: unknown;
|
|
487
|
+
}[];
|
|
488
|
+
itemsReceived: number;
|
|
489
|
+
curPage: number;
|
|
490
|
+
nextPage: number | null;
|
|
491
|
+
prevPage: number | null;
|
|
492
|
+
offset: number;
|
|
493
|
+
perPage: number;
|
|
494
|
+
}>], `${string}/documents`, "GET"> & {
|
|
495
|
+
getPath: (opts?: {
|
|
496
|
+
canonical?: string;
|
|
497
|
+
}) => string;
|
|
498
|
+
toSearchParams: {
|
|
499
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
500
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
501
|
+
};
|
|
502
|
+
} & {
|
|
503
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
504
|
+
};
|
|
505
|
+
listDocuments: _xano_sdk.QueryDef<{
|
|
506
|
+
readonly page: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
507
|
+
readonly default: 1;
|
|
508
|
+
readonly description: "Page number (1-based).";
|
|
509
|
+
}, "int">;
|
|
510
|
+
readonly per_page: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
511
|
+
readonly default: 20;
|
|
512
|
+
readonly description: "Number of documents per page.";
|
|
513
|
+
}, "int">;
|
|
514
|
+
}, ListDocumentsResult, _xano_sdk.RefValue<"docs">, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"docs", {
|
|
515
|
+
items: {
|
|
516
|
+
[x: string]: unknown;
|
|
517
|
+
}[];
|
|
518
|
+
itemsReceived: number;
|
|
519
|
+
curPage: number;
|
|
520
|
+
nextPage: number | null;
|
|
521
|
+
prevPage: number | null;
|
|
522
|
+
offset: number;
|
|
523
|
+
perPage: number;
|
|
524
|
+
}>], `${string}/documents`, "GET"> & {
|
|
525
|
+
getPath: (opts?: {
|
|
526
|
+
canonical?: string;
|
|
527
|
+
}) => string;
|
|
528
|
+
toSearchParams: {
|
|
529
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
530
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
531
|
+
};
|
|
532
|
+
} & {
|
|
533
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
534
|
+
};
|
|
535
|
+
get: _xano_sdk.QueryDef<{
|
|
536
|
+
readonly id: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
537
|
+
readonly required: true;
|
|
538
|
+
readonly description: "Document ID.";
|
|
539
|
+
}, "int">;
|
|
540
|
+
}, GetDocumentResult, _xano_sdk.ObjValue<{
|
|
541
|
+
document: _xano_sdk.RefValue<"doc">;
|
|
542
|
+
chunks: _xano_sdk.RefValue<"chunks">;
|
|
543
|
+
}>, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"doc", {
|
|
544
|
+
[x: string]: unknown;
|
|
545
|
+
} | null>, _xano_sdk.Statement, ..._xano_sdk.Statement[], _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"chunks", {
|
|
546
|
+
id: number;
|
|
547
|
+
created_at: number;
|
|
548
|
+
document_id: number;
|
|
549
|
+
document_title: string;
|
|
550
|
+
chunk_index: number;
|
|
551
|
+
content: string;
|
|
552
|
+
mime_type: string;
|
|
553
|
+
embedding: number[] | null;
|
|
554
|
+
metadata: unknown;
|
|
555
|
+
char_count: number;
|
|
556
|
+
}[]>], `${string}/documents/{id}`, "GET"> & {
|
|
557
|
+
getPath: (opts: {
|
|
558
|
+
canonical?: string;
|
|
559
|
+
params: {
|
|
560
|
+
id: string | number;
|
|
561
|
+
};
|
|
562
|
+
}) => string;
|
|
563
|
+
toSearchParams: {
|
|
564
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
565
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
566
|
+
};
|
|
567
|
+
} & {
|
|
568
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
569
|
+
};
|
|
570
|
+
getDocument: _xano_sdk.QueryDef<{
|
|
571
|
+
readonly id: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
572
|
+
readonly required: true;
|
|
573
|
+
readonly description: "Document ID.";
|
|
574
|
+
}, "int">;
|
|
575
|
+
}, GetDocumentResult, _xano_sdk.ObjValue<{
|
|
576
|
+
document: _xano_sdk.RefValue<"doc">;
|
|
577
|
+
chunks: _xano_sdk.RefValue<"chunks">;
|
|
578
|
+
}>, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"doc", {
|
|
579
|
+
[x: string]: unknown;
|
|
580
|
+
} | null>, _xano_sdk.Statement, ..._xano_sdk.Statement[], _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"chunks", {
|
|
581
|
+
id: number;
|
|
582
|
+
created_at: number;
|
|
583
|
+
document_id: number;
|
|
584
|
+
document_title: string;
|
|
585
|
+
chunk_index: number;
|
|
586
|
+
content: string;
|
|
587
|
+
mime_type: string;
|
|
588
|
+
embedding: number[] | null;
|
|
589
|
+
metadata: unknown;
|
|
590
|
+
char_count: number;
|
|
591
|
+
}[]>], `${string}/documents/{id}`, "GET"> & {
|
|
592
|
+
getPath: (opts: {
|
|
593
|
+
canonical?: string;
|
|
594
|
+
params: {
|
|
595
|
+
id: string | number;
|
|
596
|
+
};
|
|
597
|
+
}) => string;
|
|
598
|
+
toSearchParams: {
|
|
599
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
600
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
601
|
+
};
|
|
602
|
+
} & {
|
|
603
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
604
|
+
};
|
|
605
|
+
delete: _xano_sdk.QueryDef<{
|
|
606
|
+
readonly id: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
607
|
+
readonly required: true;
|
|
608
|
+
readonly description: "Document ID to delete.";
|
|
609
|
+
}, "int">;
|
|
610
|
+
}, DeleteDocumentResult, _xano_sdk.ObjValue<{
|
|
611
|
+
deleted: _xano_sdk.ConstValue<true>;
|
|
612
|
+
id: _xano_sdk.RefValue<"doc.id">;
|
|
613
|
+
}>, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"doc", {
|
|
614
|
+
[x: string]: unknown;
|
|
615
|
+
} | null>, _xano_sdk.Statement, ..._xano_sdk.Statement[], _xano_sdk.Statement & _xano_sdk.AsShapeBrand<string, number>, _xano_sdk.Statement], `${string}/documents/{id}/delete`, "DELETE"> & {
|
|
616
|
+
getPath: (opts: {
|
|
617
|
+
canonical?: string;
|
|
618
|
+
params: {
|
|
619
|
+
id: string | number;
|
|
620
|
+
};
|
|
621
|
+
}) => string;
|
|
622
|
+
toSearchParams: {
|
|
623
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
624
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
625
|
+
};
|
|
626
|
+
} & {
|
|
627
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
628
|
+
};
|
|
629
|
+
deleteDocument: _xano_sdk.QueryDef<{
|
|
630
|
+
readonly id: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
631
|
+
readonly required: true;
|
|
632
|
+
readonly description: "Document ID to delete.";
|
|
633
|
+
}, "int">;
|
|
634
|
+
}, DeleteDocumentResult, _xano_sdk.ObjValue<{
|
|
635
|
+
deleted: _xano_sdk.ConstValue<true>;
|
|
636
|
+
id: _xano_sdk.RefValue<"doc.id">;
|
|
637
|
+
}>, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"doc", {
|
|
638
|
+
[x: string]: unknown;
|
|
639
|
+
} | null>, _xano_sdk.Statement, ..._xano_sdk.Statement[], _xano_sdk.Statement & _xano_sdk.AsShapeBrand<string, number>, _xano_sdk.Statement], `${string}/documents/{id}/delete`, "DELETE"> & {
|
|
640
|
+
getPath: (opts: {
|
|
641
|
+
canonical?: string;
|
|
642
|
+
params: {
|
|
643
|
+
id: string | number;
|
|
644
|
+
};
|
|
645
|
+
}) => string;
|
|
646
|
+
toSearchParams: {
|
|
647
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
648
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
649
|
+
};
|
|
650
|
+
} & {
|
|
651
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
652
|
+
};
|
|
653
|
+
reindex: _xano_sdk.QueryDef<{
|
|
654
|
+
readonly id: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
655
|
+
readonly required: true;
|
|
656
|
+
readonly description: "Document ID to reindex.";
|
|
657
|
+
}, "int">;
|
|
658
|
+
readonly strategy: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<"fixed" | "paragraph" | "sentence" | "markdown" | "custom", {
|
|
659
|
+
readonly required: false;
|
|
660
|
+
readonly description: "New chunking algorithm (fixed, paragraph, sentence, markdown, custom).";
|
|
661
|
+
}, "enum">;
|
|
662
|
+
readonly chunk_size: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
663
|
+
readonly required: false;
|
|
664
|
+
readonly description: "Updated target chunk size.";
|
|
665
|
+
}, "int">;
|
|
666
|
+
readonly chunk_overlap: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
667
|
+
readonly required: false;
|
|
668
|
+
readonly description: "Updated chunk overlap.";
|
|
669
|
+
}, "int">;
|
|
670
|
+
}, ReindexDocumentResult, _xano_sdk.RefValue<"ingest_res">, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"doc", {
|
|
671
|
+
[x: string]: unknown;
|
|
672
|
+
} | null>, _xano_sdk.Statement, ..._xano_sdk.Statement[], _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"new_strategy", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"new_size", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"new_overlap", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<string, {
|
|
673
|
+
[x: string]: unknown;
|
|
674
|
+
}>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"ingest_res", {
|
|
675
|
+
document_id: number;
|
|
676
|
+
status: string;
|
|
677
|
+
chunk_count: number;
|
|
678
|
+
}>], `${string}/documents/{id}/reindex`, "POST"> & {
|
|
679
|
+
getPath: (opts: {
|
|
680
|
+
canonical?: string;
|
|
681
|
+
params: {
|
|
682
|
+
id: string | number;
|
|
683
|
+
};
|
|
684
|
+
}) => string;
|
|
685
|
+
toSearchParams: {
|
|
686
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
687
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
688
|
+
};
|
|
689
|
+
} & {
|
|
690
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
691
|
+
};
|
|
692
|
+
reindexDocument: _xano_sdk.QueryDef<{
|
|
693
|
+
readonly id: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
694
|
+
readonly required: true;
|
|
695
|
+
readonly description: "Document ID to reindex.";
|
|
696
|
+
}, "int">;
|
|
697
|
+
readonly strategy: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<"fixed" | "paragraph" | "sentence" | "markdown" | "custom", {
|
|
698
|
+
readonly required: false;
|
|
699
|
+
readonly description: "New chunking algorithm (fixed, paragraph, sentence, markdown, custom).";
|
|
700
|
+
}, "enum">;
|
|
701
|
+
readonly chunk_size: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
702
|
+
readonly required: false;
|
|
703
|
+
readonly description: "Updated target chunk size.";
|
|
704
|
+
}, "int">;
|
|
705
|
+
readonly chunk_overlap: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
706
|
+
readonly required: false;
|
|
707
|
+
readonly description: "Updated chunk overlap.";
|
|
708
|
+
}, "int">;
|
|
709
|
+
}, ReindexDocumentResult, _xano_sdk.RefValue<"ingest_res">, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"doc", {
|
|
710
|
+
[x: string]: unknown;
|
|
711
|
+
} | null>, _xano_sdk.Statement, ..._xano_sdk.Statement[], _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"new_strategy", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"new_size", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"new_overlap", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<string, {
|
|
712
|
+
[x: string]: unknown;
|
|
713
|
+
}>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"ingest_res", {
|
|
714
|
+
document_id: number;
|
|
715
|
+
status: string;
|
|
716
|
+
chunk_count: number;
|
|
717
|
+
}>], `${string}/documents/{id}/reindex`, "POST"> & {
|
|
718
|
+
getPath: (opts: {
|
|
719
|
+
canonical?: string;
|
|
720
|
+
params: {
|
|
721
|
+
id: string | number;
|
|
722
|
+
};
|
|
723
|
+
}) => string;
|
|
724
|
+
toSearchParams: {
|
|
725
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
726
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
727
|
+
};
|
|
728
|
+
} & {
|
|
729
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
730
|
+
};
|
|
731
|
+
all: readonly [_xano_sdk.QueryDef<{
|
|
732
|
+
readonly title: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
733
|
+
readonly required: true;
|
|
734
|
+
readonly description: "Title or filename for the document.";
|
|
735
|
+
}, "text">;
|
|
736
|
+
readonly content: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
737
|
+
readonly required: false;
|
|
738
|
+
readonly description: "Raw text content of the document.";
|
|
739
|
+
}, "text">;
|
|
740
|
+
readonly media_data: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
741
|
+
readonly required: false;
|
|
742
|
+
readonly description: "Base64-encoded media data (images, audio, video).";
|
|
743
|
+
}, "text">;
|
|
744
|
+
readonly mime_type: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
745
|
+
readonly default: "text/plain";
|
|
746
|
+
readonly description: "MIME type (e.g. text/markdown, image/png, audio/mp3).";
|
|
747
|
+
}, "text">;
|
|
748
|
+
readonly metadata: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<unknown, {
|
|
749
|
+
readonly required: false;
|
|
750
|
+
readonly description: "Arbitrary structured metadata.";
|
|
751
|
+
}, "json">;
|
|
752
|
+
readonly strategy: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<"fixed" | "paragraph" | "sentence" | "markdown" | "custom", {
|
|
753
|
+
readonly default: "fixed" | "paragraph" | "sentence" | "markdown" | "custom";
|
|
754
|
+
readonly description: "Chunking algorithm for text content.";
|
|
755
|
+
}, "enum">;
|
|
756
|
+
readonly chunk_size: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
757
|
+
readonly default: number;
|
|
758
|
+
readonly description: "Target maximum chunk size in characters.";
|
|
759
|
+
}, "int">;
|
|
760
|
+
readonly chunk_overlap: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
761
|
+
readonly default: number;
|
|
762
|
+
readonly description: "Chunk character overlap.";
|
|
763
|
+
}, "int">;
|
|
764
|
+
}, CreateDocumentResult, _xano_sdk.ObjValue<{
|
|
765
|
+
document: _xano_sdk.RefValue<"final_doc">;
|
|
766
|
+
chunk_count: _xano_sdk.RefValue<"ingest_res.chunk_count">;
|
|
767
|
+
status: _xano_sdk.RefValue<"ingest_res.status">;
|
|
768
|
+
}>, readonly [_xano_sdk.Statement, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"created_doc", {
|
|
769
|
+
[x: string]: unknown;
|
|
770
|
+
}>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"ingest_res", {
|
|
771
|
+
document_id: number;
|
|
772
|
+
status: string;
|
|
773
|
+
chunk_count: number;
|
|
774
|
+
}>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"final_doc", {
|
|
775
|
+
[x: string]: unknown;
|
|
776
|
+
} | null>], `${string}/documents/create`, "POST"> & {
|
|
777
|
+
getPath: (opts?: {
|
|
778
|
+
canonical?: string;
|
|
779
|
+
}) => string;
|
|
780
|
+
toSearchParams: {
|
|
781
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
782
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
783
|
+
};
|
|
784
|
+
} & {
|
|
785
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
786
|
+
}, _xano_sdk.QueryDef<{
|
|
787
|
+
readonly page: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
788
|
+
readonly default: 1;
|
|
789
|
+
readonly description: "Page number (1-based).";
|
|
790
|
+
}, "int">;
|
|
791
|
+
readonly per_page: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
792
|
+
readonly default: 20;
|
|
793
|
+
readonly description: "Number of documents per page.";
|
|
794
|
+
}, "int">;
|
|
795
|
+
}, ListDocumentsResult, _xano_sdk.RefValue<"docs">, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"docs", {
|
|
796
|
+
items: {
|
|
797
|
+
[x: string]: unknown;
|
|
798
|
+
}[];
|
|
799
|
+
itemsReceived: number;
|
|
800
|
+
curPage: number;
|
|
801
|
+
nextPage: number | null;
|
|
802
|
+
prevPage: number | null;
|
|
803
|
+
offset: number;
|
|
804
|
+
perPage: number;
|
|
805
|
+
}>], `${string}/documents`, "GET"> & {
|
|
806
|
+
getPath: (opts?: {
|
|
807
|
+
canonical?: string;
|
|
808
|
+
}) => string;
|
|
809
|
+
toSearchParams: {
|
|
810
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
811
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
812
|
+
};
|
|
813
|
+
} & {
|
|
814
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
815
|
+
}, _xano_sdk.QueryDef<{
|
|
816
|
+
readonly id: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
817
|
+
readonly required: true;
|
|
818
|
+
readonly description: "Document ID.";
|
|
819
|
+
}, "int">;
|
|
820
|
+
}, GetDocumentResult, _xano_sdk.ObjValue<{
|
|
821
|
+
document: _xano_sdk.RefValue<"doc">;
|
|
822
|
+
chunks: _xano_sdk.RefValue<"chunks">;
|
|
823
|
+
}>, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"doc", {
|
|
824
|
+
[x: string]: unknown;
|
|
825
|
+
} | null>, _xano_sdk.Statement, ..._xano_sdk.Statement[], _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"chunks", {
|
|
826
|
+
id: number;
|
|
827
|
+
created_at: number;
|
|
828
|
+
document_id: number;
|
|
829
|
+
document_title: string;
|
|
830
|
+
chunk_index: number;
|
|
831
|
+
content: string;
|
|
832
|
+
mime_type: string;
|
|
833
|
+
embedding: number[] | null;
|
|
834
|
+
metadata: unknown;
|
|
835
|
+
char_count: number;
|
|
836
|
+
}[]>], `${string}/documents/{id}`, "GET"> & {
|
|
837
|
+
getPath: (opts: {
|
|
838
|
+
canonical?: string;
|
|
839
|
+
params: {
|
|
840
|
+
id: string | number;
|
|
841
|
+
};
|
|
842
|
+
}) => string;
|
|
843
|
+
toSearchParams: {
|
|
844
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
845
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
846
|
+
};
|
|
847
|
+
} & {
|
|
848
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
849
|
+
}, _xano_sdk.QueryDef<{
|
|
850
|
+
readonly id: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
851
|
+
readonly required: true;
|
|
852
|
+
readonly description: "Document ID to delete.";
|
|
853
|
+
}, "int">;
|
|
854
|
+
}, DeleteDocumentResult, _xano_sdk.ObjValue<{
|
|
855
|
+
deleted: _xano_sdk.ConstValue<true>;
|
|
856
|
+
id: _xano_sdk.RefValue<"doc.id">;
|
|
857
|
+
}>, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"doc", {
|
|
858
|
+
[x: string]: unknown;
|
|
859
|
+
} | null>, _xano_sdk.Statement, ..._xano_sdk.Statement[], _xano_sdk.Statement & _xano_sdk.AsShapeBrand<string, number>, _xano_sdk.Statement], `${string}/documents/{id}/delete`, "DELETE"> & {
|
|
860
|
+
getPath: (opts: {
|
|
861
|
+
canonical?: string;
|
|
862
|
+
params: {
|
|
863
|
+
id: string | number;
|
|
864
|
+
};
|
|
865
|
+
}) => string;
|
|
866
|
+
toSearchParams: {
|
|
867
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
868
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
869
|
+
};
|
|
870
|
+
} & {
|
|
871
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
872
|
+
}, _xano_sdk.QueryDef<{
|
|
873
|
+
readonly id: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
874
|
+
readonly required: true;
|
|
875
|
+
readonly description: "Document ID to reindex.";
|
|
876
|
+
}, "int">;
|
|
877
|
+
readonly strategy: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<"fixed" | "paragraph" | "sentence" | "markdown" | "custom", {
|
|
878
|
+
readonly required: false;
|
|
879
|
+
readonly description: "New chunking algorithm (fixed, paragraph, sentence, markdown, custom).";
|
|
880
|
+
}, "enum">;
|
|
881
|
+
readonly chunk_size: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
882
|
+
readonly required: false;
|
|
883
|
+
readonly description: "Updated target chunk size.";
|
|
884
|
+
}, "int">;
|
|
885
|
+
readonly chunk_overlap: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
886
|
+
readonly required: false;
|
|
887
|
+
readonly description: "Updated chunk overlap.";
|
|
888
|
+
}, "int">;
|
|
889
|
+
}, ReindexDocumentResult, _xano_sdk.RefValue<"ingest_res">, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"doc", {
|
|
890
|
+
[x: string]: unknown;
|
|
891
|
+
} | null>, _xano_sdk.Statement, ..._xano_sdk.Statement[], _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"new_strategy", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"new_size", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"new_overlap", unknown>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<string, {
|
|
892
|
+
[x: string]: unknown;
|
|
893
|
+
}>, _xano_sdk.Statement & _xano_sdk.AsShapeBrand<"ingest_res", {
|
|
894
|
+
document_id: number;
|
|
895
|
+
status: string;
|
|
896
|
+
chunk_count: number;
|
|
897
|
+
}>], `${string}/documents/{id}/reindex`, "POST"> & {
|
|
898
|
+
getPath: (opts: {
|
|
899
|
+
canonical?: string;
|
|
900
|
+
params: {
|
|
901
|
+
id: string | number;
|
|
902
|
+
};
|
|
903
|
+
}) => string;
|
|
904
|
+
toSearchParams: {
|
|
905
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
906
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
907
|
+
};
|
|
908
|
+
} & {
|
|
909
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
910
|
+
}];
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
declare function searchQueries(opts: ResolvedOptions, group: VectorGroup, searchFn: SearchVectorsFn, embedFn: GenerateEmbeddingFn): {
|
|
914
|
+
search: _xano_sdk.QueryDef<{
|
|
915
|
+
readonly query: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
916
|
+
readonly required: false;
|
|
917
|
+
readonly description: "Natural language query string.";
|
|
918
|
+
}, "text">;
|
|
919
|
+
readonly query_media_data: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
920
|
+
readonly required: false;
|
|
921
|
+
readonly description: "Base64-encoded media data for visual/audio search queries.";
|
|
922
|
+
}, "text">;
|
|
923
|
+
readonly query_mime_type: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
924
|
+
readonly default: "text/plain";
|
|
925
|
+
readonly description: "MIME type for media data if provided.";
|
|
926
|
+
}, "text">;
|
|
927
|
+
readonly query_embedding: _xano_sdk.FieldDescriptor & _xano_sdk.TypeBrand<number[], {
|
|
928
|
+
readonly required: false;
|
|
929
|
+
readonly description: "Pre-computed 768-dimensional query vector.";
|
|
930
|
+
}, "vector">;
|
|
931
|
+
readonly limit: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
932
|
+
readonly default: number;
|
|
933
|
+
readonly description: "Maximum number of search results to return.";
|
|
934
|
+
}, "int">;
|
|
935
|
+
readonly threshold: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
936
|
+
readonly default: number;
|
|
937
|
+
readonly description: "Minimum similarity threshold (0.0 to 1.0).";
|
|
938
|
+
}, "decimal">;
|
|
939
|
+
}, SearchResult, _xano_sdk.ObjValue<{
|
|
940
|
+
results: _xano_sdk.RefValue<"search_res.results">;
|
|
941
|
+
count: _xano_sdk.RefValue<"search_res.count">;
|
|
942
|
+
}>, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"search_res", {
|
|
943
|
+
results: SearchHit[];
|
|
944
|
+
count: number;
|
|
945
|
+
}>], `${string}/search`, "POST"> & {
|
|
946
|
+
getPath: (opts?: {
|
|
947
|
+
canonical?: string;
|
|
948
|
+
}) => string;
|
|
949
|
+
toSearchParams: {
|
|
950
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
951
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
952
|
+
};
|
|
953
|
+
} & {
|
|
954
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
955
|
+
};
|
|
956
|
+
embed: _xano_sdk.QueryDef<{
|
|
957
|
+
readonly text: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
958
|
+
readonly required: false;
|
|
959
|
+
readonly description: "Text content to generate an embedding vector for.";
|
|
960
|
+
}, "text">;
|
|
961
|
+
readonly media_data: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
962
|
+
readonly required: false;
|
|
963
|
+
readonly description: "Base64 media data (image, audio, video).";
|
|
964
|
+
}, "text">;
|
|
965
|
+
readonly mime_type: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
966
|
+
readonly default: "text/plain";
|
|
967
|
+
readonly description: "MIME type for media data if provided.";
|
|
968
|
+
}, "text">;
|
|
969
|
+
readonly model: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
970
|
+
readonly default: string;
|
|
971
|
+
readonly description: "Google Gemini embedding model name.";
|
|
972
|
+
}, "text">;
|
|
973
|
+
}, EmbedResult, _xano_sdk.RefValue<"embed_res">, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"embed_res", {
|
|
974
|
+
embedding: number[];
|
|
975
|
+
dimensions: number;
|
|
976
|
+
}>], `${string}/embed`, "POST"> & {
|
|
977
|
+
getPath: (opts?: {
|
|
978
|
+
canonical?: string;
|
|
979
|
+
}) => string;
|
|
980
|
+
toSearchParams: {
|
|
981
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
982
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
983
|
+
};
|
|
984
|
+
} & {
|
|
985
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
986
|
+
};
|
|
987
|
+
all: readonly [_xano_sdk.QueryDef<{
|
|
988
|
+
readonly query: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
989
|
+
readonly required: false;
|
|
990
|
+
readonly description: "Natural language query string.";
|
|
991
|
+
}, "text">;
|
|
992
|
+
readonly query_media_data: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
993
|
+
readonly required: false;
|
|
994
|
+
readonly description: "Base64-encoded media data for visual/audio search queries.";
|
|
995
|
+
}, "text">;
|
|
996
|
+
readonly query_mime_type: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
997
|
+
readonly default: "text/plain";
|
|
998
|
+
readonly description: "MIME type for media data if provided.";
|
|
999
|
+
}, "text">;
|
|
1000
|
+
readonly query_embedding: _xano_sdk.FieldDescriptor & _xano_sdk.TypeBrand<number[], {
|
|
1001
|
+
readonly required: false;
|
|
1002
|
+
readonly description: "Pre-computed 768-dimensional query vector.";
|
|
1003
|
+
}, "vector">;
|
|
1004
|
+
readonly limit: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
1005
|
+
readonly default: number;
|
|
1006
|
+
readonly description: "Maximum number of search results to return.";
|
|
1007
|
+
}, "int">;
|
|
1008
|
+
readonly threshold: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<number, {
|
|
1009
|
+
readonly default: number;
|
|
1010
|
+
readonly description: "Minimum similarity threshold (0.0 to 1.0).";
|
|
1011
|
+
}, "decimal">;
|
|
1012
|
+
}, SearchResult, _xano_sdk.ObjValue<{
|
|
1013
|
+
results: _xano_sdk.RefValue<"search_res.results">;
|
|
1014
|
+
count: _xano_sdk.RefValue<"search_res.count">;
|
|
1015
|
+
}>, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"search_res", {
|
|
1016
|
+
results: SearchHit[];
|
|
1017
|
+
count: number;
|
|
1018
|
+
}>], `${string}/search`, "POST"> & {
|
|
1019
|
+
getPath: (opts?: {
|
|
1020
|
+
canonical?: string;
|
|
1021
|
+
}) => string;
|
|
1022
|
+
toSearchParams: {
|
|
1023
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
1024
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
1025
|
+
};
|
|
1026
|
+
} & {
|
|
1027
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
1028
|
+
}, _xano_sdk.QueryDef<{
|
|
1029
|
+
readonly text: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
1030
|
+
readonly required: false;
|
|
1031
|
+
readonly description: "Text content to generate an embedding vector for.";
|
|
1032
|
+
}, "text">;
|
|
1033
|
+
readonly media_data: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
1034
|
+
readonly required: false;
|
|
1035
|
+
readonly description: "Base64 media data (image, audio, video).";
|
|
1036
|
+
}, "text">;
|
|
1037
|
+
readonly mime_type: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
1038
|
+
readonly default: "text/plain";
|
|
1039
|
+
readonly description: "MIME type for media data if provided.";
|
|
1040
|
+
}, "text">;
|
|
1041
|
+
readonly model: _xano_sdk.InputDescriptor & _xano_sdk.TypeBrand<string, {
|
|
1042
|
+
readonly default: string;
|
|
1043
|
+
readonly description: "Google Gemini embedding model name.";
|
|
1044
|
+
}, "text">;
|
|
1045
|
+
}, EmbedResult, _xano_sdk.RefValue<"embed_res">, readonly [_xano_sdk.Statement & _xano_sdk.AsShapeBrand<"embed_res", {
|
|
1046
|
+
embedding: number[];
|
|
1047
|
+
dimensions: number;
|
|
1048
|
+
}>], `${string}/embed`, "POST"> & {
|
|
1049
|
+
getPath: (opts?: {
|
|
1050
|
+
canonical?: string;
|
|
1051
|
+
}) => string;
|
|
1052
|
+
toSearchParams: {
|
|
1053
|
+
(input: Record<string, _xano_sdk.SearchParamValue>): _xano_sdk.SearchParams;
|
|
1054
|
+
(input: Record<string, unknown>): _xano_sdk.SearchParams;
|
|
1055
|
+
};
|
|
1056
|
+
} & {
|
|
1057
|
+
auth?: string | false | _xano_sdk.TableDef<string, unknown, string> | undefined;
|
|
1058
|
+
}];
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
/**
|
|
1062
|
+
* `createVector(opts)` — builds every def for one configuration.
|
|
1063
|
+
* `registerVector(xano, opts)` — builds and registers all defs on a Xano instance.
|
|
1064
|
+
*/
|
|
1065
|
+
|
|
1066
|
+
/** Document management endpoint family. */
|
|
1067
|
+
type DocumentFamily = ReturnType<typeof documentQueries>;
|
|
1068
|
+
/** Search & embedding endpoint family. */
|
|
1069
|
+
type SearchFamily = ReturnType<typeof searchQueries>;
|
|
1070
|
+
/** Everything one `createVector` call produces. */
|
|
1071
|
+
interface Vector {
|
|
1072
|
+
options: ResolvedOptions;
|
|
1073
|
+
document: ReturnType<typeof documentTable>;
|
|
1074
|
+
chunk: ReturnType<typeof chunkTable>;
|
|
1075
|
+
embedFn: ReturnType<typeof generateEmbeddingFn>;
|
|
1076
|
+
chunkFn: ReturnType<typeof chunkTextFn>;
|
|
1077
|
+
ingestFn: ReturnType<typeof ingestDocumentFn>;
|
|
1078
|
+
searchFn: ReturnType<typeof searchVectorsFn>;
|
|
1079
|
+
searchTool: ReturnType<typeof vectorSearchTool>;
|
|
1080
|
+
group: ReturnType<typeof vectorGroup>;
|
|
1081
|
+
documents: DocumentFamily;
|
|
1082
|
+
search: SearchFamily;
|
|
1083
|
+
queries: (DocumentFamily["all"][number] | SearchFamily["all"][number])[];
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Build the full vector def set without registering anything.
|
|
1087
|
+
*
|
|
1088
|
+
* Use this to cherry-pick specific defs or wire custom combinations.
|
|
1089
|
+
*/
|
|
1090
|
+
declare function createVector(opts?: VectorOptions): Vector;
|
|
1091
|
+
/** What `registerVector` returns: the def set, plus the Xano instance. */
|
|
1092
|
+
interface RegisteredVector<X extends Xano> extends Vector {
|
|
1093
|
+
xano: X;
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Build and register the full vector embedding & search pipeline on the given instance.
|
|
1097
|
+
*
|
|
1098
|
+
* ```ts
|
|
1099
|
+
* import { workspace } from "@xano/sdk";
|
|
1100
|
+
* import { registerVector } from "@xano-sdk/vector";
|
|
1101
|
+
*
|
|
1102
|
+
* export const vector = registerVector(workspace("my-app"), {
|
|
1103
|
+
* apiKeyEnv: "GEMINI_API_KEY",
|
|
1104
|
+
* });
|
|
1105
|
+
*
|
|
1106
|
+
* export default vector.xano;
|
|
1107
|
+
* ```
|
|
1108
|
+
*/
|
|
1109
|
+
declare function registerVector<X extends Xano>(xano: X, opts?: VectorOptions): RegisteredVector<X>;
|
|
1110
|
+
|
|
1111
|
+
/**
|
|
1112
|
+
* Fully typed client-side interface describing the Vector API endpoints.
|
|
1113
|
+
*/
|
|
1114
|
+
|
|
1115
|
+
type CreateDocumentBody = CreateDocumentPayload;
|
|
1116
|
+
type CreateDocumentInput = CreateDocumentPayload;
|
|
1117
|
+
type CreateDocumentResponse = CreateDocumentResult;
|
|
1118
|
+
type ListDocumentsQuery = ListDocumentsPayload;
|
|
1119
|
+
type ListDocumentsInput = ListDocumentsPayload;
|
|
1120
|
+
type ListDocumentsResponse = ListDocumentsResult;
|
|
1121
|
+
type GetDocumentParams = {
|
|
1122
|
+
id: number;
|
|
1123
|
+
};
|
|
1124
|
+
type GetDocumentInput = {
|
|
1125
|
+
id: number;
|
|
1126
|
+
};
|
|
1127
|
+
type GetDocumentResponse = GetDocumentResult;
|
|
1128
|
+
type DeleteDocumentParams = {
|
|
1129
|
+
id: number;
|
|
1130
|
+
};
|
|
1131
|
+
type DeleteDocumentInput = {
|
|
1132
|
+
id: number;
|
|
1133
|
+
};
|
|
1134
|
+
type DeleteDocumentResponse = DeleteDocumentResult;
|
|
1135
|
+
type ReindexDocumentParams = {
|
|
1136
|
+
id: number;
|
|
1137
|
+
};
|
|
1138
|
+
type ReindexDocumentBody = ReindexDocumentPayload;
|
|
1139
|
+
type ReindexDocumentInput = {
|
|
1140
|
+
id: number;
|
|
1141
|
+
} & ReindexDocumentPayload;
|
|
1142
|
+
type ReindexDocumentResponse = ReindexDocumentResult;
|
|
1143
|
+
type SearchBody = SearchPayload;
|
|
1144
|
+
type SearchInput = SearchPayload;
|
|
1145
|
+
type SearchResponse = SearchResult;
|
|
1146
|
+
type EmbedBody = EmbedPayload;
|
|
1147
|
+
type EmbedInput = EmbedPayload;
|
|
1148
|
+
type EmbedResponse = EmbedResult;
|
|
1149
|
+
interface VectorClientEndpoints {
|
|
1150
|
+
"POST /documents/create": {
|
|
1151
|
+
request: CreateDocumentPayload;
|
|
1152
|
+
response: CreateDocumentResult;
|
|
1153
|
+
};
|
|
1154
|
+
"GET /documents": {
|
|
1155
|
+
request: ListDocumentsPayload;
|
|
1156
|
+
response: ListDocumentsResult;
|
|
1157
|
+
};
|
|
1158
|
+
"GET /documents/:id": {
|
|
1159
|
+
request: {
|
|
1160
|
+
id: number;
|
|
1161
|
+
};
|
|
1162
|
+
response: GetDocumentResult;
|
|
1163
|
+
};
|
|
1164
|
+
"DELETE /documents/:id/delete": {
|
|
1165
|
+
request: {
|
|
1166
|
+
id: number;
|
|
1167
|
+
};
|
|
1168
|
+
response: DeleteDocumentResult;
|
|
1169
|
+
};
|
|
1170
|
+
"POST /documents/:id/reindex": {
|
|
1171
|
+
request: {
|
|
1172
|
+
id: number;
|
|
1173
|
+
} & ReindexDocumentPayload;
|
|
1174
|
+
response: ReindexDocumentResult;
|
|
1175
|
+
};
|
|
1176
|
+
"POST /search": {
|
|
1177
|
+
request: SearchPayload;
|
|
1178
|
+
response: SearchResult;
|
|
1179
|
+
};
|
|
1180
|
+
"POST /embed": {
|
|
1181
|
+
request: EmbedPayload;
|
|
1182
|
+
response: EmbedResult;
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
type VectorEndpointName = keyof VectorClientEndpoints;
|
|
1186
|
+
type VectorEndpoints = VectorClientEndpoints;
|
|
1187
|
+
type VectorEndpoint<K extends VectorEndpointName> = VectorClientEndpoints[K];
|
|
1188
|
+
|
|
1189
|
+
export { CHUNK_STRATEGIES, type ChunkItem, type ChunkRow, type ChunkStrategy, type ChunkTable, type ChunkTextFn, type CreateDocumentBody, type CreateDocumentInput, type CreateDocumentPayload, type CreateDocumentResponse, type CreateDocumentResult, DEFAULT_API_KEY_ENV, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_GEMINI_MODEL, DEFAULT_NAMES, DEFAULT_SEARCH_LIMIT, DEFAULT_SEARCH_THRESHOLD, DEFAULT_STRATEGY, DOCUMENT_STATUSES, type DeleteDocumentInput, type DeleteDocumentParams, type DeleteDocumentResponse, type DeleteDocumentResult, type DocumentFamily, type DocumentRow, type DocumentStatus, type DocumentTable, type EmbedBody, type EmbedInput, type EmbedPayload, type EmbedResponse, type EmbedResult, GEMINI_EMBEDDING_DIMENSIONS, type GenerateEmbeddingFn, type GetDocumentInput, type GetDocumentParams, type GetDocumentResponse, type GetDocumentResult, type IngestDocumentFn, type ListDocumentsInput, type ListDocumentsQuery, type ListDocumentsResponse, type ListDocumentsResult, PUBLIC_CHUNK_FIELDS, PUBLIC_DOCUMENT_FIELDS, type PublicChunk, type PublicDocument, type RegisteredVector, type ReindexDocumentBody, type ReindexDocumentInput, type ReindexDocumentParams, type ReindexDocumentPayload, type ReindexDocumentResponse, type ResolvedOptions, type SearchBody, type SearchFamily, type SearchHit, type SearchInput, type SearchPayload, type SearchResponse, type SearchResult, type SearchVectorsFn, type Vector, type VectorAuthTable, type VectorEndpoint, type VectorEndpointName, type VectorEndpoints, type VectorGroup, type VectorNames, type VectorOptions, type VectorSearchTool, chunkTable, chunkTextFn, createVector, documentQueries, documentTable, generateEmbeddingFn, ingestDocumentFn, registerVector, resolveOptions, searchQueries, searchVectorsFn, vectorGroup, vectorSearchTool };
|