@mixedbread/sdk 0.1.0-alpha.10
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/CHANGELOG.md +230 -0
- package/LICENSE +201 -0
- package/README.md +360 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +241 -0
- package/core.d.ts.map +1 -0
- package/core.js +915 -0
- package/core.js.map +1 -0
- package/core.mjs +883 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +47 -0
- package/error.d.ts.map +1 -0
- package/error.js +113 -0
- package/error.js.map +1 -0
- package/error.mjs +97 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +169 -0
- package/index.d.ts +169 -0
- package/index.d.ts.map +1 -0
- package/index.js +175 -0
- package/index.js.map +1 -0
- package/index.mjs +132 -0
- package/index.mjs.map +1 -0
- package/lib/polling.d.ts +48 -0
- package/lib/polling.d.ts.map +1 -0
- package/lib/polling.js +75 -0
- package/lib/polling.js.map +1 -0
- package/lib/polling.mjs +71 -0
- package/lib/polling.mjs.map +1 -0
- package/package.json +124 -0
- package/pagination.d.ts +30 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +45 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +41 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/embeddings.d.ts +177 -0
- package/resources/embeddings.d.ts.map +1 -0
- package/resources/embeddings.js +20 -0
- package/resources/embeddings.js.map +1 -0
- package/resources/embeddings.mjs +16 -0
- package/resources/embeddings.mjs.map +1 -0
- package/resources/extractions/content.d.ts +33 -0
- package/resources/extractions/content.d.ts.map +1 -0
- package/resources/extractions/content.js +19 -0
- package/resources/extractions/content.js.map +1 -0
- package/resources/extractions/content.mjs +15 -0
- package/resources/extractions/content.mjs.map +1 -0
- package/resources/extractions/extractions.d.ts +18 -0
- package/resources/extractions/extractions.d.ts.map +1 -0
- package/resources/extractions/extractions.js +47 -0
- package/resources/extractions/extractions.js.map +1 -0
- package/resources/extractions/extractions.mjs +20 -0
- package/resources/extractions/extractions.mjs.map +1 -0
- package/resources/extractions/index.d.ts +5 -0
- package/resources/extractions/index.d.ts.map +1 -0
- package/resources/extractions/index.js +13 -0
- package/resources/extractions/index.js.map +1 -0
- package/resources/extractions/index.mjs +6 -0
- package/resources/extractions/index.mjs.map +1 -0
- package/resources/extractions/jobs.d.ts +84 -0
- package/resources/extractions/jobs.d.ts.map +1 -0
- package/resources/extractions/jobs.js +29 -0
- package/resources/extractions/jobs.js.map +1 -0
- package/resources/extractions/jobs.mjs +25 -0
- package/resources/extractions/jobs.mjs.map +1 -0
- package/resources/extractions/schema.d.ts +85 -0
- package/resources/extractions/schema.d.ts.map +1 -0
- package/resources/extractions/schema.js +39 -0
- package/resources/extractions/schema.js.map +1 -0
- package/resources/extractions/schema.mjs +35 -0
- package/resources/extractions/schema.mjs.map +1 -0
- package/resources/files.d.ts +125 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +99 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +71 -0
- package/resources/files.mjs.map +1 -0
- package/resources/index.d.ts +8 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +32 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +8 -0
- package/resources/index.mjs.map +1 -0
- package/resources/parsing/index.d.ts +3 -0
- package/resources/parsing/index.d.ts.map +1 -0
- package/resources/parsing/index.js +10 -0
- package/resources/parsing/index.js.map +1 -0
- package/resources/parsing/index.mjs +4 -0
- package/resources/parsing/index.mjs.map +1 -0
- package/resources/parsing/jobs.d.ts +290 -0
- package/resources/parsing/jobs.d.ts.map +1 -0
- package/resources/parsing/jobs.js +147 -0
- package/resources/parsing/jobs.js.map +1 -0
- package/resources/parsing/jobs.mjs +119 -0
- package/resources/parsing/jobs.mjs.map +1 -0
- package/resources/parsing/parsing.d.ts +10 -0
- package/resources/parsing/parsing.d.ts.map +1 -0
- package/resources/parsing/parsing.js +40 -0
- package/resources/parsing/parsing.js.map +1 -0
- package/resources/parsing/parsing.mjs +13 -0
- package/resources/parsing/parsing.mjs.map +1 -0
- package/resources/shared.d.ts +35 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/top-level.d.ts +165 -0
- package/resources/top-level.d.ts.map +1 -0
- package/resources/top-level.js +4 -0
- package/resources/top-level.js.map +1 -0
- package/resources/top-level.mjs +3 -0
- package/resources/top-level.mjs.map +1 -0
- package/resources/vector-stores/files.d.ts +284 -0
- package/resources/vector-stores/files.d.ts.map +1 -0
- package/resources/vector-stores/files.js +167 -0
- package/resources/vector-stores/files.js.map +1 -0
- package/resources/vector-stores/files.mjs +139 -0
- package/resources/vector-stores/files.mjs.map +1 -0
- package/resources/vector-stores/index.d.ts +3 -0
- package/resources/vector-stores/index.d.ts.map +1 -0
- package/resources/vector-stores/index.js +11 -0
- package/resources/vector-stores/index.js.map +1 -0
- package/resources/vector-stores/index.mjs +4 -0
- package/resources/vector-stores/index.mjs.map +1 -0
- package/resources/vector-stores/vector-stores.d.ts +425 -0
- package/resources/vector-stores/vector-stores.d.ts.map +1 -0
- package/resources/vector-stores/vector-stores.js +121 -0
- package/resources/vector-stores/vector-stores.js.map +1 -0
- package/resources/vector-stores/vector-stores.mjs +93 -0
- package/resources/vector-stores/vector-stores.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1208 -0
- package/src/error.ts +130 -0
- package/src/index.ts +346 -0
- package/src/lib/.keep +4 -0
- package/src/lib/polling.ts +115 -0
- package/src/pagination.ts +82 -0
- package/src/resource.ts +11 -0
- package/src/resources/embeddings.ts +248 -0
- package/src/resources/extractions/content.ts +42 -0
- package/src/resources/extractions/extractions.ts +47 -0
- package/src/resources/extractions/index.ts +14 -0
- package/src/resources/extractions/jobs.ts +105 -0
- package/src/resources/extractions/schema.ts +111 -0
- package/src/resources/files.ts +181 -0
- package/src/resources/index.ts +39 -0
- package/src/resources/parsing/index.ts +12 -0
- package/src/resources/parsing/jobs.ts +453 -0
- package/src/resources/parsing/parsing.ts +32 -0
- package/src/resources/shared.ts +41 -0
- package/src/resources/top-level.ts +231 -0
- package/src/resources/vector-stores/files.ts +439 -0
- package/src/resources/vector-stores/index.ts +31 -0
- package/src/resources/vector-stores/vector-stores.ts +592 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
@@ -0,0 +1,425 @@
|
|
1
|
+
import { APIResource } from "../../resource.js";
|
2
|
+
import * as Core from "../../core.js";
|
3
|
+
import * as Shared from "../shared.js";
|
4
|
+
import * as FilesAPI from "./files.js";
|
5
|
+
import { FileCreateParams, FileDeleteResponse, FileListParams, FileSearchParams, FileSearchResponse, Files, ScoredVectorStoreFile, VectorStoreFile, VectorStoreFilesLimitOffset } from "./files.js";
|
6
|
+
import { LimitOffset, type LimitOffsetParams } from "../../pagination.js";
|
7
|
+
export declare class VectorStores extends APIResource {
|
8
|
+
files: FilesAPI.Files;
|
9
|
+
/**
|
10
|
+
* Create a new vector store.
|
11
|
+
*
|
12
|
+
* Args: vector_store_create: VectorStoreCreate object containing the name,
|
13
|
+
* description, and metadata.
|
14
|
+
*
|
15
|
+
* Returns: VectorStore: The response containing the created vector store details.
|
16
|
+
*/
|
17
|
+
create(body: VectorStoreCreateParams, options?: Core.RequestOptions): Core.APIPromise<VectorStore>;
|
18
|
+
/**
|
19
|
+
* Get a vector store by ID.
|
20
|
+
*
|
21
|
+
* Args: vector_store_id: The ID of the vector store to retrieve.
|
22
|
+
*
|
23
|
+
* Returns: VectorStore: The response containing the vector store details.
|
24
|
+
*/
|
25
|
+
retrieve(vectorStoreId: string, options?: Core.RequestOptions): Core.APIPromise<VectorStore>;
|
26
|
+
/**
|
27
|
+
* Update a vector store by ID.
|
28
|
+
*
|
29
|
+
* Args: vector_store_id: The ID of the vector store to update.
|
30
|
+
* vector_store_update: VectorStoreCreate object containing the name, description,
|
31
|
+
* and metadata.
|
32
|
+
*
|
33
|
+
* Returns: VectorStore: The response containing the updated vector store details.
|
34
|
+
*/
|
35
|
+
update(vectorStoreId: string, body: VectorStoreUpdateParams, options?: Core.RequestOptions): Core.APIPromise<VectorStore>;
|
36
|
+
/**
|
37
|
+
* List all vector stores.
|
38
|
+
*
|
39
|
+
* Args: pagination: The pagination options.
|
40
|
+
*
|
41
|
+
* Returns: VectorStoreListResponse: The list of vector stores.
|
42
|
+
*/
|
43
|
+
list(query?: VectorStoreListParams, options?: Core.RequestOptions): Core.PagePromise<VectorStoresLimitOffset, VectorStore>;
|
44
|
+
list(options?: Core.RequestOptions): Core.PagePromise<VectorStoresLimitOffset, VectorStore>;
|
45
|
+
/**
|
46
|
+
* Delete a vector store by ID.
|
47
|
+
*
|
48
|
+
* Args: vector_store_id: The ID of the vector store to delete.
|
49
|
+
*
|
50
|
+
* Returns: VectorStore: The response containing the deleted vector store details.
|
51
|
+
*/
|
52
|
+
delete(vectorStoreId: string, options?: Core.RequestOptions): Core.APIPromise<VectorStoreDeleteResponse>;
|
53
|
+
/**
|
54
|
+
* Question answering
|
55
|
+
*/
|
56
|
+
questionAnswering(body: VectorStoreQuestionAnsweringParams, options?: Core.RequestOptions): Core.APIPromise<unknown>;
|
57
|
+
/**
|
58
|
+
* Perform semantic search across vector store chunks.
|
59
|
+
*
|
60
|
+
* This endpoint searches through vector store chunks using semantic similarity
|
61
|
+
* matching. It supports complex search queries with filters and returns
|
62
|
+
* relevance-scored results.
|
63
|
+
*
|
64
|
+
* Args: search_params: Search configuration including: - query text or
|
65
|
+
* embeddings - metadata filters - pagination parameters - sorting preferences
|
66
|
+
* \_state: API state dependency \_ctx: Service context dependency
|
67
|
+
*
|
68
|
+
* Returns: VectorStoreSearchChunkResponse containing: - List of matched chunks
|
69
|
+
* with relevance scores - Pagination details including total result count
|
70
|
+
*
|
71
|
+
* Raises: HTTPException (400): If search parameters are invalid HTTPException
|
72
|
+
* (404): If no vector stores are found to search
|
73
|
+
*/
|
74
|
+
search(body: VectorStoreSearchParams, options?: Core.RequestOptions): Core.APIPromise<VectorStoreSearchResponse>;
|
75
|
+
}
|
76
|
+
export declare class VectorStoresLimitOffset extends LimitOffset<VectorStore> {
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* Represents an expiration policy for a vector store.
|
80
|
+
*/
|
81
|
+
export interface ExpiresAfter {
|
82
|
+
/**
|
83
|
+
* Anchor date for the expiration policy
|
84
|
+
*/
|
85
|
+
anchor?: 'last_active_at';
|
86
|
+
/**
|
87
|
+
* Number of days after which the vector store expires
|
88
|
+
*/
|
89
|
+
days?: number;
|
90
|
+
}
|
91
|
+
/**
|
92
|
+
* Tracks counts of files in different states within a vector store.
|
93
|
+
*/
|
94
|
+
export interface FileCounts {
|
95
|
+
/**
|
96
|
+
* Number of files currently being processed
|
97
|
+
*/
|
98
|
+
in_progress?: number;
|
99
|
+
/**
|
100
|
+
* Number of files whose processing was cancelled
|
101
|
+
*/
|
102
|
+
cancelled?: number;
|
103
|
+
/**
|
104
|
+
* Number of successfully processed files
|
105
|
+
*/
|
106
|
+
completed?: number;
|
107
|
+
/**
|
108
|
+
* Number of files that failed processing
|
109
|
+
*/
|
110
|
+
failed?: number;
|
111
|
+
/**
|
112
|
+
* Total number of files
|
113
|
+
*/
|
114
|
+
total?: number;
|
115
|
+
}
|
116
|
+
export interface ScoredVectorStoreChunk {
|
117
|
+
/**
|
118
|
+
* position of the chunk in a file
|
119
|
+
*/
|
120
|
+
position: number;
|
121
|
+
/**
|
122
|
+
* value of the chunk
|
123
|
+
*/
|
124
|
+
value?: string | ScoredVectorStoreChunk.ImageURLInput | ScoredVectorStoreChunk.TextInput | Record<string, unknown> | null;
|
125
|
+
/**
|
126
|
+
* content of the chunk
|
127
|
+
*/
|
128
|
+
content?: string | null;
|
129
|
+
/**
|
130
|
+
* score of the chunk
|
131
|
+
*/
|
132
|
+
score: number;
|
133
|
+
/**
|
134
|
+
* file id
|
135
|
+
*/
|
136
|
+
file_id: string;
|
137
|
+
/**
|
138
|
+
* vector store id
|
139
|
+
*/
|
140
|
+
vector_store_id: string;
|
141
|
+
/**
|
142
|
+
* file metadata
|
143
|
+
*/
|
144
|
+
metadata?: unknown;
|
145
|
+
}
|
146
|
+
export declare namespace ScoredVectorStoreChunk {
|
147
|
+
/**
|
148
|
+
* Model for image input validation.
|
149
|
+
*/
|
150
|
+
interface ImageURLInput {
|
151
|
+
/**
|
152
|
+
* Input type identifier
|
153
|
+
*/
|
154
|
+
type?: 'image_url';
|
155
|
+
/**
|
156
|
+
* The image input specification.
|
157
|
+
*/
|
158
|
+
image: ImageURLInput.Image;
|
159
|
+
}
|
160
|
+
namespace ImageURLInput {
|
161
|
+
/**
|
162
|
+
* The image input specification.
|
163
|
+
*/
|
164
|
+
interface Image {
|
165
|
+
/**
|
166
|
+
* The image URL. Can be either a URL or a Data URI.
|
167
|
+
*/
|
168
|
+
url: string;
|
169
|
+
}
|
170
|
+
}
|
171
|
+
/**
|
172
|
+
* Model for text input validation.
|
173
|
+
*
|
174
|
+
* Attributes: type: Input type identifier, always "text" text: The actual text
|
175
|
+
* content, with length and whitespace constraints
|
176
|
+
*/
|
177
|
+
interface TextInput {
|
178
|
+
/**
|
179
|
+
* Input type identifier
|
180
|
+
*/
|
181
|
+
type?: 'text';
|
182
|
+
/**
|
183
|
+
* Text content to process
|
184
|
+
*/
|
185
|
+
text: string;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
/**
|
189
|
+
* Model representing a vector store with its metadata and timestamps.
|
190
|
+
*/
|
191
|
+
export interface VectorStore {
|
192
|
+
/**
|
193
|
+
* Unique identifier for the vector store
|
194
|
+
*/
|
195
|
+
id: string;
|
196
|
+
/**
|
197
|
+
* Name of the vector store
|
198
|
+
*/
|
199
|
+
name: string;
|
200
|
+
/**
|
201
|
+
* Detailed description of the vector store's purpose and contents
|
202
|
+
*/
|
203
|
+
description?: string | null;
|
204
|
+
/**
|
205
|
+
* Additional metadata associated with the vector store
|
206
|
+
*/
|
207
|
+
metadata?: unknown;
|
208
|
+
/**
|
209
|
+
* Counts of files in different states
|
210
|
+
*/
|
211
|
+
file_counts?: FileCounts;
|
212
|
+
/**
|
213
|
+
* Represents an expiration policy for a vector store.
|
214
|
+
*/
|
215
|
+
expires_after?: ExpiresAfter | null;
|
216
|
+
/**
|
217
|
+
* Processing status of the vector store
|
218
|
+
*/
|
219
|
+
status?: 'expired' | 'in_progress' | 'completed';
|
220
|
+
/**
|
221
|
+
* Timestamp when the vector store was created
|
222
|
+
*/
|
223
|
+
created_at: string;
|
224
|
+
/**
|
225
|
+
* Timestamp when the vector store was last updated
|
226
|
+
*/
|
227
|
+
updated_at: string;
|
228
|
+
/**
|
229
|
+
* Timestamp when the vector store was last used
|
230
|
+
*/
|
231
|
+
last_active_at?: string | null;
|
232
|
+
/**
|
233
|
+
* Total storage usage in bytes
|
234
|
+
*/
|
235
|
+
usage_bytes?: number;
|
236
|
+
/**
|
237
|
+
* Optional expiration timestamp for the vector store
|
238
|
+
*/
|
239
|
+
expires_at?: string | null;
|
240
|
+
/**
|
241
|
+
* Type of the object
|
242
|
+
*/
|
243
|
+
object?: 'vector_store';
|
244
|
+
}
|
245
|
+
/**
|
246
|
+
* Options for configuring vector store chunk searches.
|
247
|
+
*/
|
248
|
+
export interface VectorStoreChunkSearchOptions {
|
249
|
+
/**
|
250
|
+
* Minimum similarity score threshold
|
251
|
+
*/
|
252
|
+
score_threshold?: number;
|
253
|
+
/**
|
254
|
+
* Whether to rewrite the query
|
255
|
+
*/
|
256
|
+
rewrite_query?: boolean;
|
257
|
+
/**
|
258
|
+
* Whether to return file metadata
|
259
|
+
*/
|
260
|
+
return_metadata?: boolean;
|
261
|
+
}
|
262
|
+
/**
|
263
|
+
* Options for configuring vector store file searches.
|
264
|
+
*/
|
265
|
+
export interface VectorStoreFileSearchOptions {
|
266
|
+
/**
|
267
|
+
* Minimum similarity score threshold
|
268
|
+
*/
|
269
|
+
score_threshold?: number;
|
270
|
+
/**
|
271
|
+
* Whether to rewrite the query
|
272
|
+
*/
|
273
|
+
rewrite_query?: boolean;
|
274
|
+
/**
|
275
|
+
* Whether to return file metadata
|
276
|
+
*/
|
277
|
+
return_metadata?: boolean;
|
278
|
+
/**
|
279
|
+
* Whether to return matching text chunks
|
280
|
+
*/
|
281
|
+
return_chunks?: boolean;
|
282
|
+
/**
|
283
|
+
* Number of chunks to return for each file
|
284
|
+
*/
|
285
|
+
chunks_per_file?: number;
|
286
|
+
}
|
287
|
+
/**
|
288
|
+
* Response model for vector store deletion.
|
289
|
+
*/
|
290
|
+
export interface VectorStoreDeleteResponse {
|
291
|
+
/**
|
292
|
+
* ID of the deleted vector store
|
293
|
+
*/
|
294
|
+
id: string;
|
295
|
+
/**
|
296
|
+
* Whether the deletion was successful
|
297
|
+
*/
|
298
|
+
deleted: boolean;
|
299
|
+
/**
|
300
|
+
* Type of the deleted object
|
301
|
+
*/
|
302
|
+
object?: 'vector_store';
|
303
|
+
}
|
304
|
+
export type VectorStoreQuestionAnsweringResponse = unknown;
|
305
|
+
export interface VectorStoreSearchResponse {
|
306
|
+
/**
|
307
|
+
* The object type of the response
|
308
|
+
*/
|
309
|
+
object?: 'list';
|
310
|
+
/**
|
311
|
+
* The list of scored vector store file chunks
|
312
|
+
*/
|
313
|
+
data: Array<ScoredVectorStoreChunk>;
|
314
|
+
}
|
315
|
+
export interface VectorStoreCreateParams {
|
316
|
+
/**
|
317
|
+
* Name for the new vector store
|
318
|
+
*/
|
319
|
+
name?: string | null;
|
320
|
+
/**
|
321
|
+
* Description of the vector store
|
322
|
+
*/
|
323
|
+
description?: string | null;
|
324
|
+
/**
|
325
|
+
* Represents an expiration policy for a vector store.
|
326
|
+
*/
|
327
|
+
expires_after?: ExpiresAfter | null;
|
328
|
+
/**
|
329
|
+
* Optional metadata key-value pairs
|
330
|
+
*/
|
331
|
+
metadata?: unknown;
|
332
|
+
/**
|
333
|
+
* Optional list of file IDs
|
334
|
+
*/
|
335
|
+
file_ids?: Array<string> | null;
|
336
|
+
}
|
337
|
+
export interface VectorStoreUpdateParams {
|
338
|
+
/**
|
339
|
+
* New name for the vector store
|
340
|
+
*/
|
341
|
+
name?: string | null;
|
342
|
+
/**
|
343
|
+
* New description
|
344
|
+
*/
|
345
|
+
description?: string | null;
|
346
|
+
/**
|
347
|
+
* Represents an expiration policy for a vector store.
|
348
|
+
*/
|
349
|
+
expires_after?: ExpiresAfter | null;
|
350
|
+
/**
|
351
|
+
* Optional metadata key-value pairs
|
352
|
+
*/
|
353
|
+
metadata?: unknown;
|
354
|
+
}
|
355
|
+
export interface VectorStoreListParams extends LimitOffsetParams {
|
356
|
+
}
|
357
|
+
export interface VectorStoreQuestionAnsweringParams {
|
358
|
+
/**
|
359
|
+
* Question to answer. If not provided, the question will be extracted from the
|
360
|
+
* passed messages.
|
361
|
+
*/
|
362
|
+
query?: string;
|
363
|
+
/**
|
364
|
+
* IDs of vector stores to search
|
365
|
+
*/
|
366
|
+
vector_store_ids: Array<string>;
|
367
|
+
/**
|
368
|
+
* Number of results to return
|
369
|
+
*/
|
370
|
+
top_k?: number;
|
371
|
+
/**
|
372
|
+
* Optional filter conditions
|
373
|
+
*/
|
374
|
+
filters?: Shared.SearchFilter | Shared.SearchFilterCondition | Array<Shared.SearchFilter | Shared.SearchFilterCondition> | null;
|
375
|
+
/**
|
376
|
+
* Search configuration options
|
377
|
+
*/
|
378
|
+
search_options?: VectorStoreFileSearchOptions;
|
379
|
+
/**
|
380
|
+
* Whether to stream the answer
|
381
|
+
*/
|
382
|
+
stream?: boolean;
|
383
|
+
/**
|
384
|
+
* Question answering configuration options
|
385
|
+
*/
|
386
|
+
qa_options?: VectorStoreQuestionAnsweringParams.QaOptions;
|
387
|
+
}
|
388
|
+
export declare namespace VectorStoreQuestionAnsweringParams {
|
389
|
+
/**
|
390
|
+
* Question answering configuration options
|
391
|
+
*/
|
392
|
+
interface QaOptions {
|
393
|
+
/**
|
394
|
+
* Whether to use citations
|
395
|
+
*/
|
396
|
+
cite?: boolean;
|
397
|
+
}
|
398
|
+
}
|
399
|
+
export interface VectorStoreSearchParams {
|
400
|
+
/**
|
401
|
+
* Search query text
|
402
|
+
*/
|
403
|
+
query: string;
|
404
|
+
/**
|
405
|
+
* IDs of vector stores to search
|
406
|
+
*/
|
407
|
+
vector_store_ids: Array<string>;
|
408
|
+
/**
|
409
|
+
* Number of results to return
|
410
|
+
*/
|
411
|
+
top_k?: number;
|
412
|
+
/**
|
413
|
+
* Optional filter conditions
|
414
|
+
*/
|
415
|
+
filters?: Shared.SearchFilter | Shared.SearchFilterCondition | Array<Shared.SearchFilter | Shared.SearchFilterCondition> | null;
|
416
|
+
/**
|
417
|
+
* Search configuration options
|
418
|
+
*/
|
419
|
+
search_options?: VectorStoreChunkSearchOptions;
|
420
|
+
}
|
421
|
+
export declare namespace VectorStores {
|
422
|
+
export { type ExpiresAfter as ExpiresAfter, type FileCounts as FileCounts, type ScoredVectorStoreChunk as ScoredVectorStoreChunk, type VectorStore as VectorStore, type VectorStoreChunkSearchOptions as VectorStoreChunkSearchOptions, type VectorStoreFileSearchOptions as VectorStoreFileSearchOptions, type VectorStoreDeleteResponse as VectorStoreDeleteResponse, type VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse, type VectorStoreSearchResponse as VectorStoreSearchResponse, VectorStoresLimitOffset as VectorStoresLimitOffset, type VectorStoreCreateParams as VectorStoreCreateParams, type VectorStoreUpdateParams as VectorStoreUpdateParams, type VectorStoreListParams as VectorStoreListParams, type VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams, type VectorStoreSearchParams as VectorStoreSearchParams, };
|
423
|
+
export { Files as Files, type ScoredVectorStoreFile as ScoredVectorStoreFile, type VectorStoreFile as VectorStoreFile, type FileDeleteResponse as FileDeleteResponse, type FileSearchResponse as FileSearchResponse, VectorStoreFilesLimitOffset as VectorStoreFilesLimitOffset, type FileCreateParams as FileCreateParams, type FileListParams as FileListParams, type FileSearchParams as FileSearchParams, };
|
424
|
+
}
|
425
|
+
//# sourceMappingURL=vector-stores.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"vector-stores.d.ts","sourceRoot":"","sources":["../../src/resources/vector-stores/vector-stores.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,EACL,qBAAqB,EACrB,eAAe,EACf,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,E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B,EACjE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,uBAAuB,IAAI,uBAAuB,EAClD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,2BAA2B,IAAI,2BAA2B,EAC1D,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
"use strict";
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
+
if (k2 === undefined) k2 = k;
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
+
}
|
9
|
+
Object.defineProperty(o, k2, desc);
|
10
|
+
}) : (function(o, m, k, k2) {
|
11
|
+
if (k2 === undefined) k2 = k;
|
12
|
+
o[k2] = m[k];
|
13
|
+
}));
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
16
|
+
}) : function(o, v) {
|
17
|
+
o["default"] = v;
|
18
|
+
});
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
20
|
+
if (mod && mod.__esModule) return mod;
|
21
|
+
var result = {};
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
23
|
+
__setModuleDefault(result, mod);
|
24
|
+
return result;
|
25
|
+
};
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
27
|
+
exports.VectorStoresLimitOffset = exports.VectorStores = void 0;
|
28
|
+
const resource_1 = require("../../resource.js");
|
29
|
+
const core_1 = require("../../core.js");
|
30
|
+
const FilesAPI = __importStar(require("./files.js"));
|
31
|
+
const files_1 = require("./files.js");
|
32
|
+
const pagination_1 = require("../../pagination.js");
|
33
|
+
class VectorStores extends resource_1.APIResource {
|
34
|
+
constructor() {
|
35
|
+
super(...arguments);
|
36
|
+
this.files = new FilesAPI.Files(this._client);
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* Create a new vector store.
|
40
|
+
*
|
41
|
+
* Args: vector_store_create: VectorStoreCreate object containing the name,
|
42
|
+
* description, and metadata.
|
43
|
+
*
|
44
|
+
* Returns: VectorStore: The response containing the created vector store details.
|
45
|
+
*/
|
46
|
+
create(body, options) {
|
47
|
+
return this._client.post('/v1/vector_stores', { body, ...options });
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* Get a vector store by ID.
|
51
|
+
*
|
52
|
+
* Args: vector_store_id: The ID of the vector store to retrieve.
|
53
|
+
*
|
54
|
+
* Returns: VectorStore: The response containing the vector store details.
|
55
|
+
*/
|
56
|
+
retrieve(vectorStoreId, options) {
|
57
|
+
return this._client.get(`/v1/vector_stores/${vectorStoreId}`, options);
|
58
|
+
}
|
59
|
+
/**
|
60
|
+
* Update a vector store by ID.
|
61
|
+
*
|
62
|
+
* Args: vector_store_id: The ID of the vector store to update.
|
63
|
+
* vector_store_update: VectorStoreCreate object containing the name, description,
|
64
|
+
* and metadata.
|
65
|
+
*
|
66
|
+
* Returns: VectorStore: The response containing the updated vector store details.
|
67
|
+
*/
|
68
|
+
update(vectorStoreId, body, options) {
|
69
|
+
return this._client.put(`/v1/vector_stores/${vectorStoreId}`, { body, ...options });
|
70
|
+
}
|
71
|
+
list(query = {}, options) {
|
72
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
73
|
+
return this.list({}, query);
|
74
|
+
}
|
75
|
+
return this._client.getAPIList('/v1/vector_stores', VectorStoresLimitOffset, { query, ...options });
|
76
|
+
}
|
77
|
+
/**
|
78
|
+
* Delete a vector store by ID.
|
79
|
+
*
|
80
|
+
* Args: vector_store_id: The ID of the vector store to delete.
|
81
|
+
*
|
82
|
+
* Returns: VectorStore: The response containing the deleted vector store details.
|
83
|
+
*/
|
84
|
+
delete(vectorStoreId, options) {
|
85
|
+
return this._client.delete(`/v1/vector_stores/${vectorStoreId}`, options);
|
86
|
+
}
|
87
|
+
/**
|
88
|
+
* Question answering
|
89
|
+
*/
|
90
|
+
questionAnswering(body, options) {
|
91
|
+
return this._client.post('/v1/vector_stores/question-answering', { body, ...options });
|
92
|
+
}
|
93
|
+
/**
|
94
|
+
* Perform semantic search across vector store chunks.
|
95
|
+
*
|
96
|
+
* This endpoint searches through vector store chunks using semantic similarity
|
97
|
+
* matching. It supports complex search queries with filters and returns
|
98
|
+
* relevance-scored results.
|
99
|
+
*
|
100
|
+
* Args: search_params: Search configuration including: - query text or
|
101
|
+
* embeddings - metadata filters - pagination parameters - sorting preferences
|
102
|
+
* \_state: API state dependency \_ctx: Service context dependency
|
103
|
+
*
|
104
|
+
* Returns: VectorStoreSearchChunkResponse containing: - List of matched chunks
|
105
|
+
* with relevance scores - Pagination details including total result count
|
106
|
+
*
|
107
|
+
* Raises: HTTPException (400): If search parameters are invalid HTTPException
|
108
|
+
* (404): If no vector stores are found to search
|
109
|
+
*/
|
110
|
+
search(body, options) {
|
111
|
+
return this._client.post('/v1/vector_stores/search', { body, ...options });
|
112
|
+
}
|
113
|
+
}
|
114
|
+
exports.VectorStores = VectorStores;
|
115
|
+
class VectorStoresLimitOffset extends pagination_1.LimitOffset {
|
116
|
+
}
|
117
|
+
exports.VectorStoresLimitOffset = VectorStoresLimitOffset;
|
118
|
+
VectorStores.VectorStoresLimitOffset = VectorStoresLimitOffset;
|
119
|
+
VectorStores.Files = files_1.Files;
|
120
|
+
VectorStores.VectorStoreFilesLimitOffset = files_1.VectorStoreFilesLimitOffset;
|
121
|
+
//# sourceMappingURL=vector-stores.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"vector-stores.js","sourceRoot":"","sources":["../../src/resources/vector-stores/vector-stores.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAG9C,qDAAoC;AACpC,sCAUiB;AACjB,oDAAuE;AAEvE,MAAa,YAAa,SAAQ,sBAAW;IAA7C;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA4G3D,CAAC;IA1GC;;;;;;;OAOG;IACH,MAAM,CAAC,IAA6B,EAAE,OAA6B;QACjE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,aAAqB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CACJ,aAAqB,EACrB,IAA6B,EAC7B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;IAcD,IAAI,CACF,QAAqD,EAAE,EACvD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtG,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,aAAqB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,qBAAqB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,iBAAiB,CACf,IAAwC,EACxC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACJ,IAA6B,EAC7B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF;AA7GD,oCA6GC;AAED,MAAa,uBAAwB,SAAQ,wBAAwB;CAAG;AAAxE,0DAAwE;AA0axE,YAAY,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;AAC/D,YAAY,CAAC,KAAK,GAAG,aAAK,CAAC;AAC3B,YAAY,CAAC,2BAA2B,GAAG,mCAA2B,CAAC"}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
import { APIResource } from "../../resource.mjs";
|
3
|
+
import { isRequestOptions } from "../../core.mjs";
|
4
|
+
import * as FilesAPI from "./files.mjs";
|
5
|
+
import { Files, VectorStoreFilesLimitOffset, } from "./files.mjs";
|
6
|
+
import { LimitOffset } from "../../pagination.mjs";
|
7
|
+
export class VectorStores extends APIResource {
|
8
|
+
constructor() {
|
9
|
+
super(...arguments);
|
10
|
+
this.files = new FilesAPI.Files(this._client);
|
11
|
+
}
|
12
|
+
/**
|
13
|
+
* Create a new vector store.
|
14
|
+
*
|
15
|
+
* Args: vector_store_create: VectorStoreCreate object containing the name,
|
16
|
+
* description, and metadata.
|
17
|
+
*
|
18
|
+
* Returns: VectorStore: The response containing the created vector store details.
|
19
|
+
*/
|
20
|
+
create(body, options) {
|
21
|
+
return this._client.post('/v1/vector_stores', { body, ...options });
|
22
|
+
}
|
23
|
+
/**
|
24
|
+
* Get a vector store by ID.
|
25
|
+
*
|
26
|
+
* Args: vector_store_id: The ID of the vector store to retrieve.
|
27
|
+
*
|
28
|
+
* Returns: VectorStore: The response containing the vector store details.
|
29
|
+
*/
|
30
|
+
retrieve(vectorStoreId, options) {
|
31
|
+
return this._client.get(`/v1/vector_stores/${vectorStoreId}`, options);
|
32
|
+
}
|
33
|
+
/**
|
34
|
+
* Update a vector store by ID.
|
35
|
+
*
|
36
|
+
* Args: vector_store_id: The ID of the vector store to update.
|
37
|
+
* vector_store_update: VectorStoreCreate object containing the name, description,
|
38
|
+
* and metadata.
|
39
|
+
*
|
40
|
+
* Returns: VectorStore: The response containing the updated vector store details.
|
41
|
+
*/
|
42
|
+
update(vectorStoreId, body, options) {
|
43
|
+
return this._client.put(`/v1/vector_stores/${vectorStoreId}`, { body, ...options });
|
44
|
+
}
|
45
|
+
list(query = {}, options) {
|
46
|
+
if (isRequestOptions(query)) {
|
47
|
+
return this.list({}, query);
|
48
|
+
}
|
49
|
+
return this._client.getAPIList('/v1/vector_stores', VectorStoresLimitOffset, { query, ...options });
|
50
|
+
}
|
51
|
+
/**
|
52
|
+
* Delete a vector store by ID.
|
53
|
+
*
|
54
|
+
* Args: vector_store_id: The ID of the vector store to delete.
|
55
|
+
*
|
56
|
+
* Returns: VectorStore: The response containing the deleted vector store details.
|
57
|
+
*/
|
58
|
+
delete(vectorStoreId, options) {
|
59
|
+
return this._client.delete(`/v1/vector_stores/${vectorStoreId}`, options);
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* Question answering
|
63
|
+
*/
|
64
|
+
questionAnswering(body, options) {
|
65
|
+
return this._client.post('/v1/vector_stores/question-answering', { body, ...options });
|
66
|
+
}
|
67
|
+
/**
|
68
|
+
* Perform semantic search across vector store chunks.
|
69
|
+
*
|
70
|
+
* This endpoint searches through vector store chunks using semantic similarity
|
71
|
+
* matching. It supports complex search queries with filters and returns
|
72
|
+
* relevance-scored results.
|
73
|
+
*
|
74
|
+
* Args: search_params: Search configuration including: - query text or
|
75
|
+
* embeddings - metadata filters - pagination parameters - sorting preferences
|
76
|
+
* \_state: API state dependency \_ctx: Service context dependency
|
77
|
+
*
|
78
|
+
* Returns: VectorStoreSearchChunkResponse containing: - List of matched chunks
|
79
|
+
* with relevance scores - Pagination details including total result count
|
80
|
+
*
|
81
|
+
* Raises: HTTPException (400): If search parameters are invalid HTTPException
|
82
|
+
* (404): If no vector stores are found to search
|
83
|
+
*/
|
84
|
+
search(body, options) {
|
85
|
+
return this._client.post('/v1/vector_stores/search', { body, ...options });
|
86
|
+
}
|
87
|
+
}
|
88
|
+
export class VectorStoresLimitOffset extends LimitOffset {
|
89
|
+
}
|
90
|
+
VectorStores.VectorStoresLimitOffset = VectorStoresLimitOffset;
|
91
|
+
VectorStores.Files = Files;
|
92
|
+
VectorStores.VectorStoreFilesLimitOffset = VectorStoreFilesLimitOffset;
|
93
|
+
//# sourceMappingURL=vector-stores.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"vector-stores.mjs","sourceRoot":"","sources":["../../src/resources/vector-stores/vector-stores.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAGpB,KAAK,QAAQ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