Skip to content

Commit 4ecd2cd

Browse files
committed
removed imports added by AI
1 parent 7a46bf2 commit 4ecd2cd

File tree

6 files changed

+65
-19
lines changed

6 files changed

+65
-19
lines changed

doc/source/user_guide/agent.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ agents and run teams from Python using the existing select_ai connection objects
1111

1212
- Group agents into teams and invoke them with a single API call
1313

14+
.. latex:clearpage::
1415
1516
********
1617
``Tool``
@@ -96,6 +97,8 @@ language translation to SQL using an OCI AI profile
9697
:language: python
9798
:lines: 14-
9899

100+
.. latex:clearpage::
101+
99102
output::
100103

101104
MOVIE_SQL_TOOL
@@ -255,3 +258,37 @@ Run Team
255258
output::
256259

257260
To list the movies, you can use the SQL query: SELECT m.* FROM "SPARK_DB_USER"."MOVIE" m.
261+
262+
.. latex:clearpage::
263+
264+
*****************
265+
AI agent examples
266+
*****************
267+
268+
Web Search Agent using OpenAI's GPT model
269+
+++++++++++++++++++++++++++++++++++++++++
270+
271+
.. literalinclude:: ../../../samples/agent/websearch_agent.py
272+
:language: python
273+
274+
output::
275+
276+
Created credential: OPENAI_CRED
277+
Created profile: OPENAI_PROFILE
278+
Created tool: WEB_SEARCH_TOOL
279+
The key features of Oracle Database Machine Learning, as highlighted on the Oracle website, include:
280+
281+
- In-database machine learning: Build, train, and deploy machine learning models directly inside the Oracle Database, eliminating the need to move data.
282+
- Support for multiple languages: Use SQL, Python, and R for machine learning tasks, allowing flexibility for data scientists and developers.
283+
- Automated machine learning (AutoML): Automates feature selection, model selection, and hyperparameter tuning to speed up model development.
284+
- Scalability and performance: Utilizes Oracle Database’s scalability, security, and high performance for machine learning workloads.
285+
- Integration with Oracle Cloud: Seamlessly integrates with Oracle Cloud Infrastructure for scalable and secure deployment.
286+
- Security and governance: Inherits Oracle Database’s robust security, data privacy, and governance features.
287+
- Prebuilt algorithms: Offers a wide range of in-database algorithms for classification, regression, clustering, anomaly detection, and more.
288+
- No data movement: Keeps data secure and compliant by performing analytics and machine learning where the data resides.
289+
290+
These features enable organizations to operationalize machine learning at scale, improve productivity, and maintain data security and compliance.
291+
292+
The main topic at the URL https://www.oracle.com/artificial-intelligence/database-machine-learning is Oracle's database machine learning capabilities, specifically how Oracle integrates artificial intelligence and machine learning features directly into its database products. The page highlights how users can leverage these built-in AI and ML tools to analyze data, build predictive models, and enhance business applications without moving data outside the Oracle Database environment.
293+
294+
The main topic of the website https://openai.com is artificial intelligence research and development. OpenAI focuses on creating and promoting advanced AI technologies, including products like ChatGPT, and provides information about their research, products, and mission to ensure that artificial general intelligence benefits all of humanity.

samples/agent/tool_create.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,18 @@
2323

2424
select_ai.connect(user=user, password=password, dsn=dsn)
2525

26-
provider = select_ai.OCIGenAIProvider(
27-
region="us-chicago-1",
28-
oci_apiformat="GENERIC",
29-
model="meta.llama-4-maverick-17b-128e-instruct-fp8",
30-
)
3126
profile_attributes = select_ai.ProfileAttributes(
3227
credential_name="my_oci_ai_profile_key",
3328
object_list=[
3429
{"owner": user, "name": "MOVIE"},
3530
{"owner": user, "name": "ACTOR"},
3631
{"owner": user, "name": "DIRECTOR"},
3732
],
38-
provider=provider,
33+
provider=select_ai.OCIGenAIProvider(
34+
region="us-chicago-1",
35+
oci_apiformat="GENERIC",
36+
model="meta.llama-4-maverick-17b-128e-instruct-fp8",
37+
),
3938
)
4039
profile = select_ai.Profile(
4140
profile_name="LLAMA_4_MAVERICK",
@@ -49,7 +48,7 @@
4948
sql_tool = select_ai.agent.Tool.create_sql_tool(
5049
tool_name="MOVIE_SQL_TOOL",
5150
description="My Select AI MOVIE SQL agent tool",
52-
profile_name="oci_ai_profile",
51+
profile_name="LLAMA_4_MAVERICK",
5352
replace=True,
5453
)
5554
print(sql_tool.tool_name)

src/select_ai/agent/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
)
2020

2121
import oracledb
22-
from docutils.nodes import description
2322

2423
from select_ai import BaseProfile
2524
from select_ai._abc import SelectAIDataClass

src/select_ai/agent/tool.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from typing import AsyncGenerator, Iterator, List, Mapping, Optional, Union
1212

1313
import oracledb
14-
from oci.generative_ai_agent.models import Tool
1514

1615
from select_ai import BaseProfile
1716
from select_ai._abc import SelectAIDataClass
@@ -318,7 +317,7 @@ def create_built_in_tool(
318317
tool_type: ToolType,
319318
description: Optional[str] = None,
320319
replace: Optional[bool] = False,
321-
) -> Tool:
320+
) -> "Tool":
322321
"""
323322
Register a built-in tool
324323
@@ -356,7 +355,7 @@ def create_email_notification_tool(
356355
smtp_host: str,
357356
description: Optional[str],
358357
replace: bool = False,
359-
) -> Tool:
358+
) -> "Tool":
360359
"""
361360
Register an email notification tool
362361
@@ -394,7 +393,7 @@ def create_http_tool(
394393
endpoint: str,
395394
description: Optional[str] = None,
396395
replace: bool = False,
397-
) -> Tool:
396+
) -> "Tool":
398397
http_tool_params = HTTPToolParams(
399398
credential_name=credential_name, endpoint=endpoint
400399
)
@@ -413,7 +412,7 @@ def create_pl_sql_tool(
413412
function: str,
414413
description: Optional[str] = None,
415414
replace: bool = False,
416-
) -> Tool:
415+
) -> "Tool":
417416
"""
418417
Create a custom tool to invoke PL/SQL procedure or function
419418
@@ -440,7 +439,7 @@ def create_rag_tool(
440439
profile_name: str,
441440
description: Optional[str] = None,
442441
replace: bool = False,
443-
) -> Tool:
442+
) -> "Tool":
444443
"""
445444
Register a RAG tool, which will use a VectorIndex linked AI Profile
446445
@@ -467,7 +466,7 @@ def create_sql_tool(
467466
profile_name: str,
468467
description: Optional[str] = None,
469468
replace: bool = False,
470-
) -> Tool:
469+
) -> "Tool":
471470
"""
472471
Register a SQL tool to perform natural language to SQL translation
473472
@@ -495,7 +494,7 @@ def create_slack_notification_tool(
495494
slack_channel: str,
496495
description: Optional[str] = None,
497496
replace: bool = False,
498-
) -> Tool:
497+
) -> "Tool":
499498
"""
500499
Register a Slack notification tool
501500
@@ -526,7 +525,7 @@ def create_websearch_tool(
526525
credential_name: str,
527526
description: Optional[str],
528527
replace: bool = False,
529-
) -> Tool:
528+
) -> "Tool":
530529
"""
531530
Register a built-in websearch tool to search information
532531
on the web
@@ -577,7 +576,7 @@ def enable(self):
577576
pass
578577

579578
@classmethod
580-
def fetch(cls, tool_name: str) -> Tool:
579+
def fetch(cls, tool_name: str) -> "Tool":
581580
"""
582581
Fetch AI Tool attributes from the Database and build a proxy object in
583582
the Python layer

src/select_ai/vector_index.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@
2424
LIST_USER_VECTOR_INDEXES,
2525
)
2626

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+
2737

2838
class VectorDBProvider(StrEnum):
2939
ORACLE = "oracle"
@@ -170,6 +180,8 @@ def _get_attributes(index_name: str) -> VectorIndexAttributes:
170180
:return: select_ai.VectorIndexAttributes
171181
:raises: VectorIndexNotFoundError
172182
"""
183+
if index_name is None:
184+
raise AttributeError("'index_name' is required")
173185
with cursor() as cr:
174186
cr.execute(
175187
GET_USER_VECTOR_INDEX_ATTRIBUTES, index_name=index_name.upper()

src/select_ai/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# http://oss.oracle.com/licenses/upl.
66
# -----------------------------------------------------------------------------
77

8-
__version__ = "1.1.0"
8+
__version__ = "1.2.0rc1"

0 commit comments

Comments
 (0)