seekrai 0.4.4__py3-none-any.whl → 0.5.0__py3-none-any.whl
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.
- seekrai/__init__.py +0 -1
- seekrai/abstract/api_requestor.py +108 -251
- seekrai/abstract/response_parsing.py +99 -0
- seekrai/client.py +6 -2
- seekrai/filemanager.py +92 -3
- seekrai/resources/__init__.py +6 -1
- seekrai/resources/agents/__init__.py +11 -6
- seekrai/resources/agents/agent_inference.py +236 -29
- seekrai/resources/agents/agents.py +272 -0
- seekrai/resources/agents/threads.py +454 -0
- seekrai/resources/alignment.py +3 -9
- seekrai/resources/completions.py +3 -9
- seekrai/resources/deployments.py +4 -9
- seekrai/resources/embeddings.py +3 -9
- seekrai/resources/files.py +118 -53
- seekrai/resources/finetune.py +3 -9
- seekrai/resources/images.py +3 -5
- seekrai/resources/ingestion.py +3 -9
- seekrai/resources/models.py +35 -124
- seekrai/resources/projects.py +4 -9
- seekrai/resources/resource_base.py +10 -0
- seekrai/resources/vectordb.py +482 -0
- seekrai/types/__init__.py +87 -0
- seekrai/types/agents/__init__.py +89 -0
- seekrai/types/agents/agent.py +42 -0
- seekrai/types/agents/runs.py +117 -0
- seekrai/types/agents/threads.py +265 -0
- seekrai/types/agents/tools/__init__.py +16 -0
- seekrai/types/agents/tools/env_model_config.py +7 -0
- seekrai/types/agents/tools/schemas/__init__.py +8 -0
- seekrai/types/agents/tools/schemas/file_search.py +9 -0
- seekrai/types/agents/tools/schemas/file_search_env.py +11 -0
- seekrai/types/agents/tools/tool.py +14 -0
- seekrai/types/agents/tools/tool_env_types.py +4 -0
- seekrai/types/agents/tools/tool_types.py +10 -0
- seekrai/types/alignment.py +6 -2
- seekrai/types/files.py +3 -0
- seekrai/types/finetune.py +1 -0
- seekrai/types/models.py +3 -0
- seekrai/types/vectordb.py +78 -0
- {seekrai-0.4.4.dist-info → seekrai-0.5.0.dist-info}/METADATA +3 -3
- seekrai-0.5.0.dist-info/RECORD +67 -0
- {seekrai-0.4.4.dist-info → seekrai-0.5.0.dist-info}/WHEEL +1 -1
- seekrai-0.4.4.dist-info/RECORD +0 -49
- {seekrai-0.4.4.dist-info → seekrai-0.5.0.dist-info}/LICENSE +0 -0
- {seekrai-0.4.4.dist-info → seekrai-0.5.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from seekrai.abstract import api_requestor
|
|
4
|
+
from seekrai.resources.resource_base import ResourceBase
|
|
5
|
+
from seekrai.seekrflow_response import SeekrFlowResponse
|
|
6
|
+
from seekrai.types import (
|
|
7
|
+
SeekrFlowRequest,
|
|
8
|
+
)
|
|
9
|
+
from seekrai.types.vectordb import (
|
|
10
|
+
VectorDatabaseCreate,
|
|
11
|
+
VectorDatabaseFileList,
|
|
12
|
+
VectorDatabaseIngestionList,
|
|
13
|
+
VectorDatabaseIngestionRequest,
|
|
14
|
+
VectorDatabaseIngestionResponse,
|
|
15
|
+
VectorDatabaseList,
|
|
16
|
+
VectorDatabaseResponse,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class VectorDatabase(ResourceBase):
|
|
21
|
+
def create(
|
|
22
|
+
self,
|
|
23
|
+
name: str,
|
|
24
|
+
model: str,
|
|
25
|
+
description: Optional[str] = None,
|
|
26
|
+
) -> VectorDatabaseResponse:
|
|
27
|
+
"""
|
|
28
|
+
Create a new vector database.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
name (str): Name of the vector database.
|
|
32
|
+
model (str): Model used to generate the vectors.
|
|
33
|
+
dimension (int): Dimension of the vectors.
|
|
34
|
+
description (Optional[str], optional): Optional description. Defaults to None.
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
VectorDatabaseResponse: Object containing information about the created vector database.
|
|
38
|
+
"""
|
|
39
|
+
requestor = api_requestor.APIRequestor(
|
|
40
|
+
client=self._client,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
parameter_payload = VectorDatabaseCreate(
|
|
44
|
+
name=name, model=model, description=description
|
|
45
|
+
).model_dump()
|
|
46
|
+
|
|
47
|
+
response, _, _ = requestor.request(
|
|
48
|
+
options=SeekrFlowRequest(
|
|
49
|
+
method="POST",
|
|
50
|
+
url="flow/vectordb",
|
|
51
|
+
params=parameter_payload,
|
|
52
|
+
),
|
|
53
|
+
stream=False,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
57
|
+
return VectorDatabaseResponse(**response.data)
|
|
58
|
+
|
|
59
|
+
def list(self) -> VectorDatabaseList:
|
|
60
|
+
"""
|
|
61
|
+
Lists all vector databases for the user.
|
|
62
|
+
|
|
63
|
+
Returns:
|
|
64
|
+
VectorDatabaseList: Object containing a list of vector databases.
|
|
65
|
+
"""
|
|
66
|
+
requestor = api_requestor.APIRequestor(
|
|
67
|
+
client=self._client,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
response, _, _ = requestor.request(
|
|
71
|
+
options=SeekrFlowRequest(
|
|
72
|
+
method="GET",
|
|
73
|
+
url="flow/vectordb",
|
|
74
|
+
),
|
|
75
|
+
stream=False,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
79
|
+
return VectorDatabaseList(**response.data)
|
|
80
|
+
|
|
81
|
+
def retrieve(self, database_id: str) -> VectorDatabaseResponse:
|
|
82
|
+
"""
|
|
83
|
+
Retrieves vector database details.
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
database_id (str): Vector database ID to retrieve.
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
VectorDatabaseResponse: Object containing information about the vector database.
|
|
90
|
+
"""
|
|
91
|
+
requestor = api_requestor.APIRequestor(
|
|
92
|
+
client=self._client,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
response, _, _ = requestor.request(
|
|
96
|
+
options=SeekrFlowRequest(
|
|
97
|
+
method="GET",
|
|
98
|
+
url=f"flow/vectordb/{database_id}",
|
|
99
|
+
),
|
|
100
|
+
stream=False,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
104
|
+
return VectorDatabaseResponse(**response.data)
|
|
105
|
+
|
|
106
|
+
def create_ingestion_job(
|
|
107
|
+
self,
|
|
108
|
+
database_id: str,
|
|
109
|
+
files: List[str],
|
|
110
|
+
method: str,
|
|
111
|
+
token_count: int = 800,
|
|
112
|
+
overlap_tokens: int = 100,
|
|
113
|
+
) -> VectorDatabaseIngestionResponse:
|
|
114
|
+
"""
|
|
115
|
+
Start an ingestion job for the specified files.
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
database_id (str): ID of the vector database to ingest into.
|
|
119
|
+
files (List[str]): List of file IDs to ingest.
|
|
120
|
+
method (str): Method to use for ingestion.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
VectorDatabaseIngestionResponse: Object containing information about the created ingestion job.
|
|
124
|
+
"""
|
|
125
|
+
requestor = api_requestor.APIRequestor(
|
|
126
|
+
client=self._client,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
parameter_payload = VectorDatabaseIngestionRequest(
|
|
130
|
+
file_ids=files,
|
|
131
|
+
method=method,
|
|
132
|
+
token_count=token_count,
|
|
133
|
+
overlap_tokens=overlap_tokens,
|
|
134
|
+
).model_dump()
|
|
135
|
+
|
|
136
|
+
response, _, _ = requestor.request(
|
|
137
|
+
options=SeekrFlowRequest(
|
|
138
|
+
method="POST",
|
|
139
|
+
url=f"flow/vectordb/{database_id}/ingestion",
|
|
140
|
+
params=parameter_payload,
|
|
141
|
+
),
|
|
142
|
+
stream=False,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
146
|
+
return VectorDatabaseIngestionResponse(**response.data)
|
|
147
|
+
|
|
148
|
+
def list_ingestion_jobs(self, database_id: str) -> VectorDatabaseIngestionList:
|
|
149
|
+
"""
|
|
150
|
+
Lists ingestion job history for a specific vector database.
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
database_id (str): ID of the vector database.
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
VectorDatabaseIngestionList: Object containing a list of ingestion jobs.
|
|
157
|
+
"""
|
|
158
|
+
requestor = api_requestor.APIRequestor(
|
|
159
|
+
client=self._client,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
response, _, _ = requestor.request(
|
|
163
|
+
options=SeekrFlowRequest(
|
|
164
|
+
method="GET",
|
|
165
|
+
url=f"flow/vectordb/{database_id}/ingestion",
|
|
166
|
+
),
|
|
167
|
+
stream=False,
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
171
|
+
return VectorDatabaseIngestionList(**response.data)
|
|
172
|
+
|
|
173
|
+
def retrieve_ingestion_job(
|
|
174
|
+
self, database_id: str, job_id: str
|
|
175
|
+
) -> VectorDatabaseIngestionResponse:
|
|
176
|
+
"""
|
|
177
|
+
Retrieves ingestion job details.
|
|
178
|
+
|
|
179
|
+
Args:
|
|
180
|
+
database_id (str): ID of the vector database.
|
|
181
|
+
job_id (str): Ingestion job ID to retrieve.
|
|
182
|
+
|
|
183
|
+
Returns:
|
|
184
|
+
VectorDatabaseIngestionResponse: Object containing information about the ingestion job.
|
|
185
|
+
"""
|
|
186
|
+
requestor = api_requestor.APIRequestor(
|
|
187
|
+
client=self._client,
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
response, _, _ = requestor.request(
|
|
191
|
+
options=SeekrFlowRequest(
|
|
192
|
+
method="GET",
|
|
193
|
+
url=f"flow/vectordb/{database_id}/ingestion/{job_id}",
|
|
194
|
+
),
|
|
195
|
+
stream=False,
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
199
|
+
return VectorDatabaseIngestionResponse(**response.data)
|
|
200
|
+
|
|
201
|
+
def list_files(self, database_id: str) -> VectorDatabaseFileList:
|
|
202
|
+
"""
|
|
203
|
+
Lists all files in a vector database.
|
|
204
|
+
|
|
205
|
+
Args:
|
|
206
|
+
database_id (str): ID of the vector database.
|
|
207
|
+
|
|
208
|
+
Returns:
|
|
209
|
+
VectorDatabaseFileList: Object containing a list of files in the vector database.
|
|
210
|
+
"""
|
|
211
|
+
requestor = api_requestor.APIRequestor(
|
|
212
|
+
client=self._client,
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
response, _, _ = requestor.request(
|
|
216
|
+
options=SeekrFlowRequest(
|
|
217
|
+
method="GET",
|
|
218
|
+
url=f"flow/vectordb/{database_id}/files",
|
|
219
|
+
),
|
|
220
|
+
stream=False,
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
224
|
+
return VectorDatabaseFileList(**response.data)
|
|
225
|
+
|
|
226
|
+
def delete(self, database_id: str) -> None:
|
|
227
|
+
"""
|
|
228
|
+
Delete a vector database.
|
|
229
|
+
|
|
230
|
+
Args:
|
|
231
|
+
database_id (str): ID of the vector database to delete.
|
|
232
|
+
|
|
233
|
+
Returns:
|
|
234
|
+
None
|
|
235
|
+
"""
|
|
236
|
+
requestor = api_requestor.APIRequestor(
|
|
237
|
+
client=self._client,
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
response, _, _ = requestor.request(
|
|
241
|
+
options=SeekrFlowRequest(
|
|
242
|
+
method="DELETE",
|
|
243
|
+
url=f"flow/vectordb/{database_id}",
|
|
244
|
+
),
|
|
245
|
+
stream=False,
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
# The endpoint returns 204 No Content
|
|
249
|
+
return None
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
class AsyncVectorDatabase(ResourceBase):
|
|
253
|
+
async def create(
|
|
254
|
+
self,
|
|
255
|
+
name: str,
|
|
256
|
+
model: str,
|
|
257
|
+
description: Optional[str] = None,
|
|
258
|
+
) -> VectorDatabaseResponse:
|
|
259
|
+
"""
|
|
260
|
+
Create a new vector database asynchronously.
|
|
261
|
+
|
|
262
|
+
Args:
|
|
263
|
+
name (str): Name of the vector database.
|
|
264
|
+
model (str): Model used to generate the vectors.
|
|
265
|
+
description (Optional[str], optional): Optional description. Defaults to None.
|
|
266
|
+
|
|
267
|
+
Returns:
|
|
268
|
+
VectorDatabaseResponse: Object containing information about the created vector database.
|
|
269
|
+
"""
|
|
270
|
+
requestor = api_requestor.APIRequestor(
|
|
271
|
+
client=self._client,
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
parameter_payload = VectorDatabaseCreate(
|
|
275
|
+
name=name, model=model, description=description
|
|
276
|
+
).model_dump()
|
|
277
|
+
|
|
278
|
+
response, _, _ = await requestor.arequest(
|
|
279
|
+
options=SeekrFlowRequest(
|
|
280
|
+
method="POST",
|
|
281
|
+
url="flow/vectordb",
|
|
282
|
+
params=parameter_payload,
|
|
283
|
+
),
|
|
284
|
+
stream=False,
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
288
|
+
return VectorDatabaseResponse(**response.data)
|
|
289
|
+
|
|
290
|
+
async def list(self) -> VectorDatabaseList:
|
|
291
|
+
"""
|
|
292
|
+
Lists all vector databases for the user asynchronously.
|
|
293
|
+
|
|
294
|
+
Returns:
|
|
295
|
+
VectorDatabaseList: Object containing a list of vector databases.
|
|
296
|
+
"""
|
|
297
|
+
requestor = api_requestor.APIRequestor(
|
|
298
|
+
client=self._client,
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
response, _, _ = await requestor.arequest(
|
|
302
|
+
options=SeekrFlowRequest(
|
|
303
|
+
method="GET",
|
|
304
|
+
url="flow/vectordb",
|
|
305
|
+
),
|
|
306
|
+
stream=False,
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
310
|
+
return VectorDatabaseList(**response.data)
|
|
311
|
+
|
|
312
|
+
async def retrieve(self, database_id: str) -> VectorDatabaseResponse:
|
|
313
|
+
"""
|
|
314
|
+
Retrieves vector database details asynchronously.
|
|
315
|
+
|
|
316
|
+
Args:
|
|
317
|
+
database_id (str): Vector database ID to retrieve.
|
|
318
|
+
|
|
319
|
+
Returns:
|
|
320
|
+
VectorDatabaseResponse: Object containing information about the vector database.
|
|
321
|
+
"""
|
|
322
|
+
requestor = api_requestor.APIRequestor(
|
|
323
|
+
client=self._client,
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
response, _, _ = await requestor.arequest(
|
|
327
|
+
options=SeekrFlowRequest(
|
|
328
|
+
method="GET",
|
|
329
|
+
url=f"flow/vectordb/{database_id}",
|
|
330
|
+
),
|
|
331
|
+
stream=False,
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
335
|
+
return VectorDatabaseResponse(**response.data)
|
|
336
|
+
|
|
337
|
+
async def create_ingestion_job(
|
|
338
|
+
self,
|
|
339
|
+
database_id: str,
|
|
340
|
+
files: List[str],
|
|
341
|
+
method: str,
|
|
342
|
+
token_count: int = 800,
|
|
343
|
+
overlap_tokens: int = 100,
|
|
344
|
+
) -> VectorDatabaseIngestionResponse:
|
|
345
|
+
"""
|
|
346
|
+
Start an ingestion job for the specified files asynchronously.
|
|
347
|
+
|
|
348
|
+
Args:
|
|
349
|
+
database_id (str): ID of the vector database to ingest into.
|
|
350
|
+
files (List[str]): List of file IDs to ingest.
|
|
351
|
+
method (str): Method to use for ingestion.
|
|
352
|
+
|
|
353
|
+
Returns:
|
|
354
|
+
VectorDatabaseIngestionResponse: Object containing information about the created ingestion job.
|
|
355
|
+
"""
|
|
356
|
+
requestor = api_requestor.APIRequestor(
|
|
357
|
+
client=self._client,
|
|
358
|
+
)
|
|
359
|
+
|
|
360
|
+
parameter_payload = VectorDatabaseIngestionRequest(
|
|
361
|
+
file_ids=files,
|
|
362
|
+
method=method,
|
|
363
|
+
token_count=token_count,
|
|
364
|
+
overlap_tokens=overlap_tokens,
|
|
365
|
+
).model_dump()
|
|
366
|
+
|
|
367
|
+
response, _, _ = await requestor.arequest(
|
|
368
|
+
options=SeekrFlowRequest(
|
|
369
|
+
method="POST",
|
|
370
|
+
url=f"flow/vectordb/{database_id}/ingestion",
|
|
371
|
+
params=parameter_payload,
|
|
372
|
+
),
|
|
373
|
+
stream=False,
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
377
|
+
return VectorDatabaseIngestionResponse(**response.data)
|
|
378
|
+
|
|
379
|
+
async def list_ingestion_jobs(
|
|
380
|
+
self, database_id: str
|
|
381
|
+
) -> VectorDatabaseIngestionList:
|
|
382
|
+
"""
|
|
383
|
+
Lists ingestion job history for a specific vector database asynchronously.
|
|
384
|
+
|
|
385
|
+
Args:
|
|
386
|
+
database_id (str): ID of the vector database.
|
|
387
|
+
|
|
388
|
+
Returns:
|
|
389
|
+
VectorDatabaseIngestionList: Object containing a list of ingestion jobs.
|
|
390
|
+
"""
|
|
391
|
+
requestor = api_requestor.APIRequestor(
|
|
392
|
+
client=self._client,
|
|
393
|
+
)
|
|
394
|
+
|
|
395
|
+
response, _, _ = await requestor.arequest(
|
|
396
|
+
options=SeekrFlowRequest(
|
|
397
|
+
method="GET",
|
|
398
|
+
url=f"flow/vectordb/{database_id}/ingestion",
|
|
399
|
+
),
|
|
400
|
+
stream=False,
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
404
|
+
return VectorDatabaseIngestionList(**response.data)
|
|
405
|
+
|
|
406
|
+
async def retrieve_ingestion_job(
|
|
407
|
+
self, database_id: str, job_id: str
|
|
408
|
+
) -> VectorDatabaseIngestionResponse:
|
|
409
|
+
"""
|
|
410
|
+
Retrieves ingestion job details asynchronously.
|
|
411
|
+
|
|
412
|
+
Args:
|
|
413
|
+
database_id (str): ID of the vector database.
|
|
414
|
+
job_id (str): Ingestion job ID to retrieve.
|
|
415
|
+
|
|
416
|
+
Returns:
|
|
417
|
+
VectorDatabaseIngestionResponse: Object containing information about the ingestion job.
|
|
418
|
+
"""
|
|
419
|
+
requestor = api_requestor.APIRequestor(
|
|
420
|
+
client=self._client,
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
response, _, _ = await requestor.arequest(
|
|
424
|
+
options=SeekrFlowRequest(
|
|
425
|
+
method="GET",
|
|
426
|
+
url=f"flow/vectordb/{database_id}/ingestion/{job_id}",
|
|
427
|
+
),
|
|
428
|
+
stream=False,
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
432
|
+
return VectorDatabaseIngestionResponse(**response.data)
|
|
433
|
+
|
|
434
|
+
async def list_files(self, database_id: str) -> VectorDatabaseFileList:
|
|
435
|
+
"""
|
|
436
|
+
Lists all files in a vector database asynchronously.
|
|
437
|
+
|
|
438
|
+
Args:
|
|
439
|
+
database_id (str): ID of the vector database.
|
|
440
|
+
|
|
441
|
+
Returns:
|
|
442
|
+
VectorDatabaseFileList: Object containing a list of files in the vector database.
|
|
443
|
+
"""
|
|
444
|
+
requestor = api_requestor.APIRequestor(
|
|
445
|
+
client=self._client,
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
response, _, _ = await requestor.arequest(
|
|
449
|
+
options=SeekrFlowRequest(
|
|
450
|
+
method="GET",
|
|
451
|
+
url=f"flow/vectordb/{database_id}/files",
|
|
452
|
+
),
|
|
453
|
+
stream=False,
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
assert isinstance(response, SeekrFlowResponse)
|
|
457
|
+
return VectorDatabaseFileList(**response.data)
|
|
458
|
+
|
|
459
|
+
async def delete(self, database_id: str) -> None:
|
|
460
|
+
"""
|
|
461
|
+
Delete a vector database asynchronously.
|
|
462
|
+
|
|
463
|
+
Args:
|
|
464
|
+
database_id (str): ID of the vector database to delete.
|
|
465
|
+
|
|
466
|
+
Returns:
|
|
467
|
+
None
|
|
468
|
+
"""
|
|
469
|
+
requestor = api_requestor.APIRequestor(
|
|
470
|
+
client=self._client,
|
|
471
|
+
)
|
|
472
|
+
|
|
473
|
+
response, _, _ = await requestor.arequest(
|
|
474
|
+
options=SeekrFlowRequest(
|
|
475
|
+
method="DELETE",
|
|
476
|
+
url=f"flow/vectordb/{database_id}",
|
|
477
|
+
),
|
|
478
|
+
stream=False,
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
# The endpoint returns 204 No Content
|
|
482
|
+
return None
|
seekrai/types/__init__.py
CHANGED
|
@@ -1,4 +1,49 @@
|
|
|
1
1
|
from seekrai.types.abstract import SeekrFlowClient
|
|
2
|
+
from seekrai.types.agents import (
|
|
3
|
+
Agent,
|
|
4
|
+
AgentDeleteResponse,
|
|
5
|
+
AgentStatus,
|
|
6
|
+
CreateAgentRequest,
|
|
7
|
+
Env,
|
|
8
|
+
EnvConfig,
|
|
9
|
+
FileSearch,
|
|
10
|
+
FileSearchEnv,
|
|
11
|
+
InputFile,
|
|
12
|
+
InputImage,
|
|
13
|
+
InputMessage,
|
|
14
|
+
InputText,
|
|
15
|
+
MessageUpdateRequest,
|
|
16
|
+
OutputGuardrail,
|
|
17
|
+
OutputMessage,
|
|
18
|
+
OutputText,
|
|
19
|
+
Run,
|
|
20
|
+
RunRequest,
|
|
21
|
+
RunResponse,
|
|
22
|
+
RunStatus,
|
|
23
|
+
RunStep,
|
|
24
|
+
RunStepUsage,
|
|
25
|
+
RunUsage,
|
|
26
|
+
StreamEndNodeChunk,
|
|
27
|
+
StreamFinalResultEventChunk,
|
|
28
|
+
StreamingToolRequest,
|
|
29
|
+
StreamingToolResponse,
|
|
30
|
+
StreamNodeHeaderChunk,
|
|
31
|
+
StreamPartStartEventChunk,
|
|
32
|
+
StreamReasoningChunk,
|
|
33
|
+
StreamTextChunk,
|
|
34
|
+
StreamTextDeltaChunk,
|
|
35
|
+
StreamToolCallPartDeltaChunk,
|
|
36
|
+
StreamUserPromptChunk,
|
|
37
|
+
Thread,
|
|
38
|
+
ThreadCreateRequest,
|
|
39
|
+
ThreadMessage,
|
|
40
|
+
ThreadMessageContentType,
|
|
41
|
+
ThreadStatus,
|
|
42
|
+
Tool,
|
|
43
|
+
ToolBase,
|
|
44
|
+
ToolType,
|
|
45
|
+
)
|
|
46
|
+
from seekrai.types.agents.tools.schemas import FileSearch, FileSearchEnv
|
|
2
47
|
from seekrai.types.alignment import (
|
|
3
48
|
AlignmentEstimationRequest,
|
|
4
49
|
AlignmentEstimationResponse,
|
|
@@ -107,4 +152,46 @@ __all__ = [
|
|
|
107
152
|
"GetDeploymentsResponse",
|
|
108
153
|
"HardwareType",
|
|
109
154
|
"NewDeploymentRequest",
|
|
155
|
+
"MessageUpdateRequest",
|
|
156
|
+
"ThreadCreateRequest",
|
|
157
|
+
"ThreadStatus",
|
|
158
|
+
"Thread",
|
|
159
|
+
"StreamReasoningChunk",
|
|
160
|
+
"StreamTextChunk",
|
|
161
|
+
"StreamingToolRequest",
|
|
162
|
+
"StreamingToolResponse",
|
|
163
|
+
"StreamNodeHeaderChunk",
|
|
164
|
+
"StreamUserPromptChunk",
|
|
165
|
+
"StreamPartStartEventChunk",
|
|
166
|
+
"StreamToolCallPartDeltaChunk",
|
|
167
|
+
"StreamFinalResultEventChunk",
|
|
168
|
+
"StreamEndNodeChunk",
|
|
169
|
+
"StreamTextDeltaChunk",
|
|
170
|
+
"InputText",
|
|
171
|
+
"InputMessage",
|
|
172
|
+
"InputFile",
|
|
173
|
+
"InputImage",
|
|
174
|
+
"OutputMessage",
|
|
175
|
+
"OutputText",
|
|
176
|
+
"OutputGuardrail",
|
|
177
|
+
"ThreadMessage",
|
|
178
|
+
"ThreadMessageContentType",
|
|
179
|
+
"RunResponse",
|
|
180
|
+
"Run",
|
|
181
|
+
"RunRequest",
|
|
182
|
+
"RunStep",
|
|
183
|
+
"RunUsage",
|
|
184
|
+
"RunStatus",
|
|
185
|
+
"RunStepUsage",
|
|
186
|
+
"Agent",
|
|
187
|
+
"AgentStatus",
|
|
188
|
+
"CreateAgentRequest",
|
|
189
|
+
"AgentDeleteResponse",
|
|
190
|
+
"ToolBase",
|
|
191
|
+
"ToolType",
|
|
192
|
+
"EnvConfig",
|
|
193
|
+
"Env",
|
|
194
|
+
"Tool",
|
|
195
|
+
"FileSearch",
|
|
196
|
+
"FileSearchEnv",
|
|
110
197
|
]
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
from seekrai.types.agents.agent import (
|
|
2
|
+
Agent,
|
|
3
|
+
AgentDeleteResponse,
|
|
4
|
+
AgentStatus,
|
|
5
|
+
CreateAgentRequest,
|
|
6
|
+
)
|
|
7
|
+
from seekrai.types.agents.runs import (
|
|
8
|
+
Run,
|
|
9
|
+
RunRequest,
|
|
10
|
+
RunResponse,
|
|
11
|
+
RunStatus,
|
|
12
|
+
RunStep,
|
|
13
|
+
RunStepUsage,
|
|
14
|
+
RunUsage,
|
|
15
|
+
)
|
|
16
|
+
from seekrai.types.agents.threads import (
|
|
17
|
+
InputFile,
|
|
18
|
+
InputImage,
|
|
19
|
+
InputMessage,
|
|
20
|
+
InputText,
|
|
21
|
+
MessageUpdateRequest,
|
|
22
|
+
OutputGuardrail,
|
|
23
|
+
OutputMessage,
|
|
24
|
+
OutputText,
|
|
25
|
+
StreamEndNodeChunk,
|
|
26
|
+
StreamFinalResultEventChunk,
|
|
27
|
+
StreamingToolRequest,
|
|
28
|
+
StreamingToolResponse,
|
|
29
|
+
StreamNodeHeaderChunk,
|
|
30
|
+
StreamPartStartEventChunk,
|
|
31
|
+
StreamReasoningChunk,
|
|
32
|
+
StreamTextChunk,
|
|
33
|
+
StreamTextDeltaChunk,
|
|
34
|
+
StreamToolCallPartDeltaChunk,
|
|
35
|
+
StreamUserPromptChunk,
|
|
36
|
+
Thread,
|
|
37
|
+
ThreadCreateRequest,
|
|
38
|
+
ThreadMessage,
|
|
39
|
+
ThreadMessageContentType,
|
|
40
|
+
ThreadStatus,
|
|
41
|
+
)
|
|
42
|
+
from seekrai.types.agents.tools import Env, EnvConfig, Tool, ToolBase, ToolType
|
|
43
|
+
from seekrai.types.agents.tools.schemas import FileSearch, FileSearchEnv
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
__all__ = [
|
|
47
|
+
"RunResponse",
|
|
48
|
+
"Run",
|
|
49
|
+
"RunRequest",
|
|
50
|
+
"RunStep",
|
|
51
|
+
"RunUsage",
|
|
52
|
+
"RunStatus",
|
|
53
|
+
"RunStepUsage",
|
|
54
|
+
"MessageUpdateRequest",
|
|
55
|
+
"ThreadCreateRequest",
|
|
56
|
+
"ThreadStatus",
|
|
57
|
+
"Thread",
|
|
58
|
+
"StreamReasoningChunk",
|
|
59
|
+
"StreamTextChunk",
|
|
60
|
+
"StreamingToolRequest",
|
|
61
|
+
"StreamingToolResponse",
|
|
62
|
+
"StreamNodeHeaderChunk",
|
|
63
|
+
"StreamUserPromptChunk",
|
|
64
|
+
"StreamPartStartEventChunk",
|
|
65
|
+
"StreamToolCallPartDeltaChunk",
|
|
66
|
+
"StreamFinalResultEventChunk",
|
|
67
|
+
"StreamEndNodeChunk",
|
|
68
|
+
"StreamTextDeltaChunk",
|
|
69
|
+
"InputText",
|
|
70
|
+
"InputMessage",
|
|
71
|
+
"InputFile",
|
|
72
|
+
"InputImage",
|
|
73
|
+
"OutputMessage",
|
|
74
|
+
"OutputText",
|
|
75
|
+
"OutputGuardrail",
|
|
76
|
+
"ThreadMessage",
|
|
77
|
+
"ThreadMessageContentType",
|
|
78
|
+
"Agent",
|
|
79
|
+
"AgentStatus",
|
|
80
|
+
"CreateAgentRequest",
|
|
81
|
+
"AgentDeleteResponse",
|
|
82
|
+
"ToolBase",
|
|
83
|
+
"ToolType",
|
|
84
|
+
"EnvConfig",
|
|
85
|
+
"Env",
|
|
86
|
+
"Tool",
|
|
87
|
+
"FileSearch",
|
|
88
|
+
"FileSearchEnv",
|
|
89
|
+
]
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import enum
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
|
|
7
|
+
from seekrai.types.agents.tools.tool_types import Tool
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AgentStatus(str, enum.Enum):
|
|
11
|
+
INACTIVE = "Inactive"
|
|
12
|
+
PENDING = "Pending"
|
|
13
|
+
ACTIVE = "Active"
|
|
14
|
+
FAILED = "Failed"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class CreateAgentRequest(BaseModel):
|
|
18
|
+
name: str
|
|
19
|
+
instructions: str
|
|
20
|
+
tools: list[Tool]
|
|
21
|
+
model_id: str
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class Agent(BaseModel):
|
|
25
|
+
model_config = ConfigDict(from_attributes=True)
|
|
26
|
+
|
|
27
|
+
id: str
|
|
28
|
+
name: str
|
|
29
|
+
instructions: str
|
|
30
|
+
status: AgentStatus
|
|
31
|
+
model_id: str
|
|
32
|
+
user_id: str
|
|
33
|
+
tools: list[Tool]
|
|
34
|
+
created_at: datetime
|
|
35
|
+
updated_at: datetime
|
|
36
|
+
last_deployed_at: Optional[datetime] = None
|
|
37
|
+
active_duration: int = Field(default=0, ge=0)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class AgentDeleteResponse(BaseModel):
|
|
41
|
+
id: str
|
|
42
|
+
deleted: bool
|