select-ai 1.1.0rc1__py3-none-any.whl → 1.2.0rc1__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.
Potentially problematic release.
This version of select-ai might be problematic. Click here for more details.
- select_ai/agent/__init__.py +24 -0
- select_ai/agent/core.py +235 -0
- select_ai/agent/sql.py +80 -0
- select_ai/agent/task.py +247 -0
- select_ai/agent/team.py +280 -0
- select_ai/agent/tool.py +620 -0
- select_ai/async_profile.py +1 -1
- select_ai/base_profile.py +1 -1
- select_ai/errors.py +40 -0
- select_ai/profile.py +2 -2
- select_ai/sql.py +10 -4
- select_ai/vector_index.py +84 -36
- select_ai/version.py +1 -1
- {select_ai-1.1.0rc1.dist-info → select_ai-1.2.0rc1.dist-info}/METADATA +1 -1
- select_ai-1.2.0rc1.dist-info/RECORD +28 -0
- select_ai-1.1.0rc1.dist-info/RECORD +0 -22
- {select_ai-1.1.0rc1.dist-info → select_ai-1.2.0rc1.dist-info}/WHEEL +0 -0
- {select_ai-1.1.0rc1.dist-info → select_ai-1.2.0rc1.dist-info}/licenses/LICENSE.txt +0 -0
- {select_ai-1.1.0rc1.dist-info → select_ai-1.2.0rc1.dist-info}/top_level.txt +0 -0
select_ai/sql.py
CHANGED
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
GRANT_PRIVILEGES_TO_USER = """
|
|
9
9
|
DECLARE
|
|
10
|
-
TYPE array_t IS VARRAY(
|
|
10
|
+
TYPE array_t IS VARRAY(4) OF VARCHAR2(60);
|
|
11
11
|
v_packages array_t;
|
|
12
12
|
BEGIN
|
|
13
13
|
v_packages := array_t(
|
|
14
|
-
'DBMS_CLOUD',
|
|
14
|
+
'DBMS_CLOUD',
|
|
15
|
+
'DBMS_CLOUD_AI',
|
|
16
|
+
'DBMS_CLOUD_AI_AGENT',
|
|
17
|
+
'DBMS_CLOUD_PIPELINE'
|
|
15
18
|
);
|
|
16
19
|
FOR i in 1..v_packages.count LOOP
|
|
17
20
|
EXECUTE IMMEDIATE
|
|
@@ -22,11 +25,14 @@ END;
|
|
|
22
25
|
|
|
23
26
|
REVOKE_PRIVILEGES_FROM_USER = """
|
|
24
27
|
DECLARE
|
|
25
|
-
TYPE array_t IS VARRAY(
|
|
28
|
+
TYPE array_t IS VARRAY(4) OF VARCHAR2(60);
|
|
26
29
|
v_packages array_t;
|
|
27
30
|
BEGIN
|
|
28
31
|
v_packages := array_t(
|
|
29
|
-
'DBMS_CLOUD',
|
|
32
|
+
'DBMS_CLOUD',
|
|
33
|
+
'DBMS_CLOUD_AI',
|
|
34
|
+
'DBMS_CLOUD_AI_AGENT',
|
|
35
|
+
'DBMS_CLOUD_PIPELINE'
|
|
30
36
|
);
|
|
31
37
|
FOR i in 1..v_packages.count LOOP
|
|
32
38
|
EXECUTE IMMEDIATE
|
select_ai/vector_index.py
CHANGED
|
@@ -17,13 +17,23 @@ from select_ai._abc import SelectAIDataClass
|
|
|
17
17
|
from select_ai._enums import StrEnum
|
|
18
18
|
from select_ai.async_profile import AsyncProfile
|
|
19
19
|
from select_ai.db import async_cursor, cursor
|
|
20
|
-
from select_ai.errors import
|
|
20
|
+
from select_ai.errors import ProfileNotFoundError, VectorIndexNotFoundError
|
|
21
21
|
from select_ai.profile import Profile
|
|
22
22
|
from select_ai.sql import (
|
|
23
23
|
GET_USER_VECTOR_INDEX_ATTRIBUTES,
|
|
24
24
|
LIST_USER_VECTOR_INDEXES,
|
|
25
25
|
)
|
|
26
26
|
|
|
27
|
+
UNMODIFIABLE_VECTOR_INDEX_ATTRIBUTES = (
|
|
28
|
+
"location",
|
|
29
|
+
"chunk_size",
|
|
30
|
+
"chunk_overlap",
|
|
31
|
+
"pipeline_name",
|
|
32
|
+
"vector_dimension",
|
|
33
|
+
"vector_table_name",
|
|
34
|
+
"vector_distance_metric",
|
|
35
|
+
)
|
|
36
|
+
|
|
27
37
|
|
|
28
38
|
class VectorDBProvider(StrEnum):
|
|
29
39
|
ORACLE = "oracle"
|
|
@@ -93,9 +103,14 @@ class VectorIndexAttributes(SelectAIDataClass):
|
|
|
93
103
|
attributes = self.dict(exclude_null=exclude_null)
|
|
94
104
|
attributes.pop("pipeline_name", None)
|
|
95
105
|
# Currently, the following are unmodifiable
|
|
96
|
-
unmodifiable = [
|
|
97
|
-
|
|
98
|
-
|
|
106
|
+
unmodifiable = [
|
|
107
|
+
"location",
|
|
108
|
+
"chunk_size",
|
|
109
|
+
"chunk_overlap",
|
|
110
|
+
"vector_dimension",
|
|
111
|
+
"vector_table_name",
|
|
112
|
+
"vector_distance_metric",
|
|
113
|
+
]
|
|
99
114
|
if for_update:
|
|
100
115
|
for key in unmodifiable:
|
|
101
116
|
attributes.pop(key, None)
|
|
@@ -165,8 +180,12 @@ class VectorIndex(_BaseVectorIndex):
|
|
|
165
180
|
:return: select_ai.VectorIndexAttributes
|
|
166
181
|
:raises: VectorIndexNotFoundError
|
|
167
182
|
"""
|
|
183
|
+
if index_name is None:
|
|
184
|
+
raise AttributeError("'index_name' is required")
|
|
168
185
|
with cursor() as cr:
|
|
169
|
-
cr.execute(
|
|
186
|
+
cr.execute(
|
|
187
|
+
GET_USER_VECTOR_INDEX_ATTRIBUTES, index_name=index_name.upper()
|
|
188
|
+
)
|
|
170
189
|
attributes = cr.fetchall()
|
|
171
190
|
if attributes:
|
|
172
191
|
post_processed_attributes = {}
|
|
@@ -255,10 +274,18 @@ class VectorIndex(_BaseVectorIndex):
|
|
|
255
274
|
|
|
256
275
|
"""
|
|
257
276
|
with cursor() as cr:
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
277
|
+
try:
|
|
278
|
+
cr.callproc(
|
|
279
|
+
"DBMS_CLOUD_AI.ENABLE_VECTOR_INDEX",
|
|
280
|
+
keyword_parameters={"index_name": self.index_name},
|
|
281
|
+
)
|
|
282
|
+
except oracledb.Error as e:
|
|
283
|
+
(error,) = e.args
|
|
284
|
+
# ORA-20000: Vector Index is already in the desired status
|
|
285
|
+
if error.code == 20000:
|
|
286
|
+
pass
|
|
287
|
+
else:
|
|
288
|
+
raise
|
|
262
289
|
|
|
263
290
|
def disable(self):
|
|
264
291
|
"""This procedure disables a vector index object in the current
|
|
@@ -271,15 +298,23 @@ class VectorIndex(_BaseVectorIndex):
|
|
|
271
298
|
:raises: oracledb.DatabaseError
|
|
272
299
|
"""
|
|
273
300
|
with cursor() as cr:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
301
|
+
try:
|
|
302
|
+
cr.callproc(
|
|
303
|
+
"DBMS_CLOUD_AI.DISABLE_VECTOR_INDEX",
|
|
304
|
+
keyword_parameters={"index_name": self.index_name},
|
|
305
|
+
)
|
|
306
|
+
except oracledb.Error as e:
|
|
307
|
+
(error,) = e.args
|
|
308
|
+
# ORA-20000: Vector Index is already in the desired status
|
|
309
|
+
if error.code == 20000:
|
|
310
|
+
pass
|
|
311
|
+
else:
|
|
312
|
+
raise
|
|
278
313
|
|
|
279
314
|
def set_attribute(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
315
|
+
self,
|
|
316
|
+
attribute_name: str,
|
|
317
|
+
attribute_value: Union[str, int, float],
|
|
283
318
|
):
|
|
284
319
|
"""
|
|
285
320
|
This procedure updates an existing vector store index with a specified
|
|
@@ -293,7 +328,7 @@ class VectorIndex(_BaseVectorIndex):
|
|
|
293
328
|
parameters = {
|
|
294
329
|
"index_name": self.index_name,
|
|
295
330
|
"attribute_name": attribute_name,
|
|
296
|
-
"attribute_value": attribute_value
|
|
331
|
+
"attribute_value": attribute_value,
|
|
297
332
|
}
|
|
298
333
|
with cursor() as cr:
|
|
299
334
|
cr.callproc(
|
|
@@ -301,7 +336,6 @@ class VectorIndex(_BaseVectorIndex):
|
|
|
301
336
|
keyword_parameters=parameters,
|
|
302
337
|
)
|
|
303
338
|
|
|
304
|
-
|
|
305
339
|
def set_attributes(
|
|
306
340
|
self,
|
|
307
341
|
attribute_name: Optional[str] = None,
|
|
@@ -504,10 +538,18 @@ class AsyncVectorIndex(_BaseVectorIndex):
|
|
|
504
538
|
|
|
505
539
|
"""
|
|
506
540
|
async with async_cursor() as cr:
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
541
|
+
try:
|
|
542
|
+
await cr.callproc(
|
|
543
|
+
"DBMS_CLOUD_AI.ENABLE_VECTOR_INDEX",
|
|
544
|
+
keyword_parameters={"index_name": self.index_name},
|
|
545
|
+
)
|
|
546
|
+
except oracledb.DatabaseError as e:
|
|
547
|
+
(error,) = e.args
|
|
548
|
+
# ORA-20000: Vector Index is already in the desired status
|
|
549
|
+
if error.code == 20000:
|
|
550
|
+
pass
|
|
551
|
+
else:
|
|
552
|
+
raise
|
|
511
553
|
|
|
512
554
|
async def disable(self) -> None:
|
|
513
555
|
"""This procedure disables a vector index object in the current
|
|
@@ -520,15 +562,20 @@ class AsyncVectorIndex(_BaseVectorIndex):
|
|
|
520
562
|
:raises: oracledb.DatabaseError
|
|
521
563
|
"""
|
|
522
564
|
async with async_cursor() as cr:
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
565
|
+
try:
|
|
566
|
+
await cr.callproc(
|
|
567
|
+
"DBMS_CLOUD_AI.DISABLE_VECTOR_INDEX",
|
|
568
|
+
keyword_parameters={"index_name": self.index_name},
|
|
569
|
+
)
|
|
570
|
+
except oracledb.Error as e:
|
|
571
|
+
(error,) = e.args
|
|
572
|
+
if error.code == 20000:
|
|
573
|
+
pass
|
|
574
|
+
else:
|
|
575
|
+
raise
|
|
527
576
|
|
|
528
577
|
async def set_attribute(
|
|
529
|
-
|
|
530
|
-
attribute_name: str,
|
|
531
|
-
attribute_value: Union[str, int, float]
|
|
578
|
+
self, attribute_name: str, attribute_value: Union[str, int, float]
|
|
532
579
|
) -> None:
|
|
533
580
|
"""
|
|
534
581
|
This procedure updates an existing vector store index with a specified
|
|
@@ -538,9 +585,11 @@ class AsyncVectorIndex(_BaseVectorIndex):
|
|
|
538
585
|
:param Union[str, int, float] attribute_value: Attribute Value
|
|
539
586
|
|
|
540
587
|
"""
|
|
541
|
-
parameters = {
|
|
542
|
-
|
|
543
|
-
|
|
588
|
+
parameters = {
|
|
589
|
+
"index_name": self.index_name,
|
|
590
|
+
"attribute_name": attribute_name,
|
|
591
|
+
"attribute_value": attribute_value,
|
|
592
|
+
}
|
|
544
593
|
setattr(self.attributes, attribute_name, attribute_value)
|
|
545
594
|
async with async_cursor() as cr:
|
|
546
595
|
await cr.callproc(
|
|
@@ -548,7 +597,6 @@ class AsyncVectorIndex(_BaseVectorIndex):
|
|
|
548
597
|
keyword_parameters=parameters,
|
|
549
598
|
)
|
|
550
599
|
|
|
551
|
-
|
|
552
600
|
async def set_attributes(
|
|
553
601
|
self,
|
|
554
602
|
attribute_name: Optional[str] = None,
|
|
@@ -563,8 +611,8 @@ class AsyncVectorIndex(_BaseVectorIndex):
|
|
|
563
611
|
|
|
564
612
|
:param str attribute_name: Custom attribute name
|
|
565
613
|
:param Union[str, int, float] attribute_value: Attribute Value
|
|
566
|
-
:param VectorIndexAttributes attributes:
|
|
567
|
-
|
|
614
|
+
:param select_ai.VectorIndexAttributes attributes: Use this to
|
|
615
|
+
update multiple attribute values
|
|
568
616
|
:return: None
|
|
569
617
|
:raises: oracledb.DatabaseError
|
|
570
618
|
"""
|
|
@@ -643,5 +691,5 @@ class AsyncVectorIndex(_BaseVectorIndex):
|
|
|
643
691
|
index_name=index_name,
|
|
644
692
|
description=description,
|
|
645
693
|
attributes=attributes,
|
|
646
|
-
profile=profile
|
|
694
|
+
profile=profile,
|
|
647
695
|
)
|
select_ai/version.py
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
select_ai/__init__.py,sha256=5oVcMxHqKPnIqzsPntFrqrMrTQ86bDrJsG8ARXuxN7U,1460
|
|
2
|
+
select_ai/_abc.py,sha256=ccec6yu54w5QMix_EKc_BJ_0JatUDXKjfLW9KshOGak,2692
|
|
3
|
+
select_ai/_enums.py,sha256=U0UavuE4pbRY-0-Qb8z-F7KfxU0YUfOgUahaSjDi0dU,416
|
|
4
|
+
select_ai/_validations.py,sha256=flMtAhYE-H2hgLdKNf26Lfs0mzISJZOXPIvrAXjC1Og,3959
|
|
5
|
+
select_ai/action.py,sha256=s78uhi5HHCLbTN2S5tLDSswTLUl40FZ3nESLka8CfZk,592
|
|
6
|
+
select_ai/async_profile.py,sha256=Q5rEsr-XY8Snn31ePHlhRXkBT_gROpGMIi2Yhz9mFKg,18968
|
|
7
|
+
select_ai/base_profile.py,sha256=Ip1IaKpvAWs1vma4HqciuEIo21WI6l_8swCiEDLW_jg,7261
|
|
8
|
+
select_ai/conversation.py,sha256=fbYH7ROLwpyf1VzNtcrESG1S0_ZfLJ-uObbvbUATJUY,9622
|
|
9
|
+
select_ai/credential.py,sha256=cDIsiPgjbvckbOfb2LeoztPUsDO-6cJ_S8DzYT3pm4k,4220
|
|
10
|
+
select_ai/db.py,sha256=ipyXt5_wEXAQGl7PLVq82FBuePdA_e6b8ee_vhEAMks,4723
|
|
11
|
+
select_ai/errors.py,sha256=06mKo0Z2lipzIsPIxVUXhbF3Vw4tRqzHOzZfv5xbyv4,3104
|
|
12
|
+
select_ai/profile.py,sha256=CMotnQRwW-XkXTNrhxiaYnlsurjHksQOsb3PMqgbjPM,16368
|
|
13
|
+
select_ai/provider.py,sha256=mMOWJIh3p3wxHsijW1vr6OvkXIk81HNyRyuIEsNijFE,8426
|
|
14
|
+
select_ai/sql.py,sha256=UBINldCDBQ3iswtA9F4CB6JntvmT8AdYd6_gvB8twBE,2880
|
|
15
|
+
select_ai/synthetic_data.py,sha256=fClMI6ue2rNqzjY9TfeLA0_w1iPOahb08Y-1-gYzwzs,3305
|
|
16
|
+
select_ai/vector_index.py,sha256=Q2w4qnnlAXrqKagPUIOOf6MUdb_yAnsnU2HtiFYvPTI,25498
|
|
17
|
+
select_ai/version.py,sha256=0HJ4C5R4gudaimbDn4c-WHa03LWqWKfEVUgiFEGzlvE,346
|
|
18
|
+
select_ai/agent/__init__.py,sha256=cv5WLaiEKgBlVaQ-qRl7HS9WqSufmXmXLp26pKfkyoo,693
|
|
19
|
+
select_ai/agent/core.py,sha256=ClaqSfmCum6WVN4iOvo6_w7mUjeUNm4Lt_RBkhDSEUw,6980
|
|
20
|
+
select_ai/agent/sql.py,sha256=oc4PiKhtNAJedTuzux-Kv_KEcsiRasANwbG9EyibAg4,2000
|
|
21
|
+
select_ai/agent/task.py,sha256=aQTiucS2uVsksleGJpCQbOi5XkFVqA2b8QqyB7t5cas,7270
|
|
22
|
+
select_ai/agent/team.py,sha256=2AqWrK-l8UJ_rpGav5oeJPYVwSGa6ExSLKXOJh5GSiM,8689
|
|
23
|
+
select_ai/agent/tool.py,sha256=9-ogSo13aQRJ2KPgo7KMImpJuh6YrHh2q35cJEm4SA8,18649
|
|
24
|
+
select_ai-1.2.0rc1.dist-info/licenses/LICENSE.txt,sha256=_0VqOxSjO1hu6JexZDVzqUXSmzH1A53EOfyiJzXTBKc,1840
|
|
25
|
+
select_ai-1.2.0rc1.dist-info/METADATA,sha256=fwD35WO6Qu9mzLZ10muLJi0wJapS3BXKls5rqn-CcxA,4489
|
|
26
|
+
select_ai-1.2.0rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
select_ai-1.2.0rc1.dist-info/top_level.txt,sha256=u_QUAHDibro58Lvi_MU6a9Wc6VfQT8HEQm0cciMTP-c,10
|
|
28
|
+
select_ai-1.2.0rc1.dist-info/RECORD,,
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
select_ai/__init__.py,sha256=5oVcMxHqKPnIqzsPntFrqrMrTQ86bDrJsG8ARXuxN7U,1460
|
|
2
|
-
select_ai/_abc.py,sha256=ccec6yu54w5QMix_EKc_BJ_0JatUDXKjfLW9KshOGak,2692
|
|
3
|
-
select_ai/_enums.py,sha256=U0UavuE4pbRY-0-Qb8z-F7KfxU0YUfOgUahaSjDi0dU,416
|
|
4
|
-
select_ai/_validations.py,sha256=flMtAhYE-H2hgLdKNf26Lfs0mzISJZOXPIvrAXjC1Og,3959
|
|
5
|
-
select_ai/action.py,sha256=s78uhi5HHCLbTN2S5tLDSswTLUl40FZ3nESLka8CfZk,592
|
|
6
|
-
select_ai/async_profile.py,sha256=KRJCcfdSIZjb3iRS7n3MjBEAFIQe-OfMLRgI4SWWPek,18967
|
|
7
|
-
select_ai/base_profile.py,sha256=touS-DofLBjTIo0NUIPXQbDq96excGYS5y-E2o4y8y8,7261
|
|
8
|
-
select_ai/conversation.py,sha256=fbYH7ROLwpyf1VzNtcrESG1S0_ZfLJ-uObbvbUATJUY,9622
|
|
9
|
-
select_ai/credential.py,sha256=cDIsiPgjbvckbOfb2LeoztPUsDO-6cJ_S8DzYT3pm4k,4220
|
|
10
|
-
select_ai/db.py,sha256=ipyXt5_wEXAQGl7PLVq82FBuePdA_e6b8ee_vhEAMks,4723
|
|
11
|
-
select_ai/errors.py,sha256=2T5eICWWjj7a907aRh7es5wTcvWm_wJiP8h0b3ipxVQ,2114
|
|
12
|
-
select_ai/profile.py,sha256=6s4v8AQmKXoK37lvKw47y-q57htQYHcIt3VP7V1mfLY,16366
|
|
13
|
-
select_ai/provider.py,sha256=mMOWJIh3p3wxHsijW1vr6OvkXIk81HNyRyuIEsNijFE,8426
|
|
14
|
-
select_ai/sql.py,sha256=9yCdB1H_sYpjMLs-6SB8xf5-QpTwCAx4cIgIsElvly4,2786
|
|
15
|
-
select_ai/synthetic_data.py,sha256=fClMI6ue2rNqzjY9TfeLA0_w1iPOahb08Y-1-gYzwzs,3305
|
|
16
|
-
select_ai/vector_index.py,sha256=Zt9JBmJZSlx6WkjVJptD6WlxxpsqDw17f7oYsN5PcM4,24089
|
|
17
|
-
select_ai/version.py,sha256=RQndK0tg4yw5xR9GR03N2OsctaItraepy-h3KNw67RE,346
|
|
18
|
-
select_ai-1.1.0rc1.dist-info/licenses/LICENSE.txt,sha256=_0VqOxSjO1hu6JexZDVzqUXSmzH1A53EOfyiJzXTBKc,1840
|
|
19
|
-
select_ai-1.1.0rc1.dist-info/METADATA,sha256=UiSQXF3OpyHk6mn9kV0wkNK2X7WBgGNaOK8J6HKzWjc,4489
|
|
20
|
-
select_ai-1.1.0rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
21
|
-
select_ai-1.1.0rc1.dist-info/top_level.txt,sha256=u_QUAHDibro58Lvi_MU6a9Wc6VfQT8HEQm0cciMTP-c,10
|
|
22
|
-
select_ai-1.1.0rc1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|