select-ai 1.0.0.dev7__tar.gz → 1.0.0.dev9__tar.gz

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.

Files changed (73) hide show
  1. select_ai-1.0.0.dev9/PKG-INFO +114 -0
  2. select_ai-1.0.0.dev9/README.md +87 -0
  3. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/pyproject.toml +3 -2
  4. select_ai-1.0.0.dev9/samples/async/create_ai_credential.py +44 -0
  5. select_ai-1.0.0.dev9/samples/async/delete_ai_credential.py +32 -0
  6. select_ai-1.0.0.dev9/samples/async/disable_ai_provider.py +33 -0
  7. select_ai-1.0.0.dev9/samples/async/enable_ai_provider.py +33 -0
  8. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/profile_explain_sql.py +1 -2
  9. select_ai-1.0.0.dev9/samples/async/profile_gen_multi_table_synthetic_data.py +48 -0
  10. select_ai-1.0.0.dev9/samples/async/profile_gen_single_table_synthetic_data.py +41 -0
  11. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/profile_run_sql.py +1 -1
  12. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/profile_show_sql.py +1 -1
  13. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/profile_sql_concurrent_tasks.py +2 -2
  14. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/conversation_chat_session.py +1 -0
  15. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/conversation_create.py +1 -0
  16. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/create_ai_credential.py +1 -0
  17. select_ai-1.0.0.dev9/samples/delete_ai_credential.py +25 -0
  18. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/profile_explain_sql.py +1 -1
  19. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/profile_narrate.py +1 -1
  20. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/profile_run_sql.py +1 -1
  21. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/profile_show_sql.py +1 -1
  22. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/__init__.py +10 -5
  23. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/async_profile.py +30 -7
  24. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/base_profile.py +7 -3
  25. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/conversation.py +16 -4
  26. select_ai-1.0.0.dev9/src/select_ai/credential.py +135 -0
  27. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/db.py +2 -2
  28. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/profile.py +30 -7
  29. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/provider.py +104 -2
  30. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/synthetic_data.py +5 -0
  31. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/vector_index.py +10 -4
  32. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/version.py +1 -1
  33. select_ai-1.0.0.dev9/src/select_ai.egg-info/PKG-INFO +114 -0
  34. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai.egg-info/SOURCES.txt +8 -1
  35. select_ai-1.0.0.dev7/PKG-INFO +0 -25
  36. select_ai-1.0.0.dev7/README.md +0 -14
  37. select_ai-1.0.0.dev7/src/select_ai/admin.py +0 -116
  38. select_ai-1.0.0.dev7/src/select_ai.egg-info/PKG-INFO +0 -25
  39. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/LICENSE.txt +0 -0
  40. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/MANIFEST.in +0 -0
  41. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/conversation_chat_session.py +0 -0
  42. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/conversations_list.py +0 -0
  43. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/profile_chat.py +0 -0
  44. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/profile_create.py +0 -0
  45. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/profile_pipeline.py +0 -0
  46. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/profiles_list.py +0 -0
  47. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/vector_index_create.py +0 -0
  48. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/vector_index_delete.py +0 -0
  49. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/vector_index_list.py +0 -0
  50. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/async/vector_index_rag.py +0 -0
  51. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/conversation_delete.py +0 -0
  52. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/conversations_list.py +0 -0
  53. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/disable_ai_provider.py +0 -0
  54. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/enable_ai_provider.py +0 -0
  55. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/profile_chat.py +0 -0
  56. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/profile_create.py +0 -0
  57. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/profile_delete.py +0 -0
  58. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/profile_gen_multi_table_synthetic_data.py +0 -0
  59. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/profile_gen_single_table_synthetic_data.py +0 -0
  60. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/profiles_list.py +0 -0
  61. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/vector_index_create.py +0 -0
  62. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/vector_index_delete.py +0 -0
  63. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/vector_index_list.py +0 -0
  64. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/samples/vector_index_rag.py +0 -0
  65. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/setup.cfg +0 -0
  66. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/_abc.py +0 -0
  67. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/_enums.py +0 -0
  68. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/action.py +0 -0
  69. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/errors.py +0 -0
  70. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai/sql.py +0 -0
  71. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai.egg-info/dependency_links.txt +0 -0
  72. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai.egg-info/requires.txt +0 -0
  73. {select_ai-1.0.0.dev7 → select_ai-1.0.0.dev9}/src/select_ai.egg-info/top_level.txt +0 -0
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: select_ai
3
+ Version: 1.0.0.dev9
4
+ Summary: Select AI for Python
5
+ Author-email: Abhishek Singh <abhishek.o.singh@oracle.com>
6
+ Maintainer-email: Abhishek Singh <abhishek.o.singh@oracle.com>
7
+ License-Expression: UPL-1.0
8
+ Keywords: oracle,select-ai,adbs,autonomous database serverless
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Natural Language :: English
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: Implementation :: CPython
20
+ Classifier: Topic :: Database
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE.txt
24
+ Requires-Dist: oracledb
25
+ Requires-Dist: pandas==2.2.3
26
+ Dynamic: license-file
27
+
28
+ # Select AI for Python
29
+
30
+
31
+ Select AI for Python enables you to ask questions of your database data using natural language (text-to-SQL), get generative AI responses using your trusted content (retrieval augmented generation), generate synthetic data using large language models, and other features – all from Python. With the general availability of Select AI Python, Python developers have access to the functionality of Select AI on Oracle Autonomous Database.
32
+
33
+ Select AI for Python enables you to leverage the broader Python ecosystem in combination with generative AI and database functionality - bridging the gap between the DBMS_CLOUD_AI PL/SQL package and Python's rich ecosystem. It provides intuitive objects and methods for AI model interaction.
34
+
35
+
36
+ ## Installation
37
+
38
+ Run
39
+ ```bash
40
+ python3 -m pip install select_ai
41
+ ```
42
+
43
+ ## Samples
44
+
45
+ Examples can be found in the [/samples][samples] directory
46
+
47
+ ### Basic Example
48
+
49
+ ```python
50
+ import select_ai
51
+
52
+ user = "<your_select_ai_user>"
53
+ password = "<your_select_ai_password>"
54
+ dsn = "<your_select_ai_db_connect_string>"
55
+
56
+ select_ai.connect(user=user, password=password, dsn=dsn)
57
+ profile = select_ai.Profile(profile_name="oci_ai_profile")
58
+ # run_sql returns a pandas dataframe
59
+ df = profile.run_sql(prompt="How many promotions?")
60
+ print(df.columns)
61
+ print(df)
62
+ ```
63
+
64
+ ### Async Example
65
+
66
+ ```python
67
+
68
+ import asyncio
69
+
70
+ import select_ai
71
+
72
+ user = "<your_select_ai_user>"
73
+ password = "<your_select_ai_password>"
74
+ dsn = "<your_select_ai_db_connect_string>"
75
+
76
+ # This example shows how to asynchronously run sql
77
+ async def main():
78
+ await select_ai.async_connect(user=user, password=password, dsn=dsn)
79
+ async_profile = await select_ai.AsyncProfile(
80
+ profile_name="async_oci_ai_profile",
81
+ )
82
+ # run_sql returns a pandas df
83
+ df = await async_profile.run_sql("How many promotions?")
84
+ print(df)
85
+
86
+ asyncio.run(main())
87
+
88
+ ```
89
+ ## Help
90
+
91
+ Questions can be asked in [GitHub Discussions][ghdiscussions].
92
+
93
+ Problem reports can be raised in [GitHub Issues][ghissues].
94
+
95
+ ## Contributing
96
+
97
+ This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide][contributing]
98
+
99
+ ## Security
100
+
101
+ Please consult the [security guide][security] for our responsible security vulnerability disclosure process
102
+
103
+ ## License
104
+
105
+ Copyright (c) 2025 Oracle and/or its affiliates.
106
+
107
+ Released under the Universal Permissive License v1.0 as shown at
108
+ <https://oss.oracle.com/licenses/upl/>.
109
+
110
+ [contributing]: https://github.com/oracle/python-select-ai/blob/main/CONTRIBUTING.md
111
+ [ghdiscussions]: https://github.com/oracle/python-select-ai/discussions
112
+ [ghissues]: https://github.com/oracle/python-select-ai/issues
113
+ [samples]: https://github.com/oracle/python-select-ai/tree/main/samples
114
+ [security]: https://github.com/oracle/python-select-ai/blob/main/SECURITY.md
@@ -0,0 +1,87 @@
1
+ # Select AI for Python
2
+
3
+
4
+ Select AI for Python enables you to ask questions of your database data using natural language (text-to-SQL), get generative AI responses using your trusted content (retrieval augmented generation), generate synthetic data using large language models, and other features – all from Python. With the general availability of Select AI Python, Python developers have access to the functionality of Select AI on Oracle Autonomous Database.
5
+
6
+ Select AI for Python enables you to leverage the broader Python ecosystem in combination with generative AI and database functionality - bridging the gap between the DBMS_CLOUD_AI PL/SQL package and Python's rich ecosystem. It provides intuitive objects and methods for AI model interaction.
7
+
8
+
9
+ ## Installation
10
+
11
+ Run
12
+ ```bash
13
+ python3 -m pip install select_ai
14
+ ```
15
+
16
+ ## Samples
17
+
18
+ Examples can be found in the [/samples][samples] directory
19
+
20
+ ### Basic Example
21
+
22
+ ```python
23
+ import select_ai
24
+
25
+ user = "<your_select_ai_user>"
26
+ password = "<your_select_ai_password>"
27
+ dsn = "<your_select_ai_db_connect_string>"
28
+
29
+ select_ai.connect(user=user, password=password, dsn=dsn)
30
+ profile = select_ai.Profile(profile_name="oci_ai_profile")
31
+ # run_sql returns a pandas dataframe
32
+ df = profile.run_sql(prompt="How many promotions?")
33
+ print(df.columns)
34
+ print(df)
35
+ ```
36
+
37
+ ### Async Example
38
+
39
+ ```python
40
+
41
+ import asyncio
42
+
43
+ import select_ai
44
+
45
+ user = "<your_select_ai_user>"
46
+ password = "<your_select_ai_password>"
47
+ dsn = "<your_select_ai_db_connect_string>"
48
+
49
+ # This example shows how to asynchronously run sql
50
+ async def main():
51
+ await select_ai.async_connect(user=user, password=password, dsn=dsn)
52
+ async_profile = await select_ai.AsyncProfile(
53
+ profile_name="async_oci_ai_profile",
54
+ )
55
+ # run_sql returns a pandas df
56
+ df = await async_profile.run_sql("How many promotions?")
57
+ print(df)
58
+
59
+ asyncio.run(main())
60
+
61
+ ```
62
+ ## Help
63
+
64
+ Questions can be asked in [GitHub Discussions][ghdiscussions].
65
+
66
+ Problem reports can be raised in [GitHub Issues][ghissues].
67
+
68
+ ## Contributing
69
+
70
+ This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide][contributing]
71
+
72
+ ## Security
73
+
74
+ Please consult the [security guide][security] for our responsible security vulnerability disclosure process
75
+
76
+ ## License
77
+
78
+ Copyright (c) 2025 Oracle and/or its affiliates.
79
+
80
+ Released under the Universal Permissive License v1.0 as shown at
81
+ <https://oss.oracle.com/licenses/upl/>.
82
+
83
+ [contributing]: https://github.com/oracle/python-select-ai/blob/main/CONTRIBUTING.md
84
+ [ghdiscussions]: https://github.com/oracle/python-select-ai/discussions
85
+ [ghissues]: https://github.com/oracle/python-select-ai/issues
86
+ [samples]: https://github.com/oracle/python-select-ai/tree/main/samples
87
+ [security]: https://github.com/oracle/python-select-ai/blob/main/SECURITY.md
@@ -5,7 +5,8 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "select_ai"
7
7
  dynamic = ["version"]
8
- description = "Python API for Select AI"
8
+ description = "Select AI for Python"
9
+ readme = {file = "README.md", content-type = "text/markdown"}
9
10
  requires-python = ">=3.9"
10
11
  authors = [
11
12
  {name="Abhishek Singh", email="abhishek.o.singh@oracle.com"}
@@ -22,7 +23,7 @@ keywords = [
22
23
  license = " UPL-1.0"
23
24
  license-files = ["LICENSE.txt"]
24
25
  classifiers = [
25
- "Development Status :: 3 - Alpha",
26
+ "Development Status :: 4 - Beta",
26
27
  "Intended Audience :: Developers",
27
28
  "Natural Language :: English",
28
29
  "Operating System :: OS Independent",
@@ -0,0 +1,44 @@
1
+ # -----------------------------------------------------------------------------
2
+ # Copyright (c) 2025, Oracle and/or its affiliates.
3
+ #
4
+ # Licensed under the Universal Permissive License v 1.0 as shown at
5
+ # http://oss.oracle.com/licenses/upl.
6
+ # -----------------------------------------------------------------------------
7
+
8
+ # -----------------------------------------------------------------------------
9
+ # async/create_ai_credential.py
10
+ #
11
+ # Async API to create credential
12
+ # -----------------------------------------------------------------------------
13
+
14
+ import asyncio
15
+ import os
16
+
17
+ import oci
18
+ import select_ai
19
+
20
+ user = os.getenv("SELECT_AI_USER")
21
+ password = os.getenv("SELECT_AI_PASSWORD")
22
+ dsn = os.getenv("SELECT_AI_DB_CONNECT_STRING")
23
+
24
+
25
+ async def main():
26
+ await select_ai.async_connect(user=user, password=password, dsn=dsn)
27
+ default_config = oci.config.from_file()
28
+ oci.config.validate_config(default_config)
29
+ with open(default_config["key_file"]) as fp:
30
+ key_contents = fp.read()
31
+ credential = {
32
+ "credential_name": "my_oci_ai_profile_key",
33
+ "user_ocid": default_config["user"],
34
+ "tenancy_ocid": default_config["tenancy"],
35
+ "private_key": key_contents,
36
+ "fingerprint": default_config["fingerprint"],
37
+ }
38
+ await select_ai.async_create_credential(
39
+ credential=credential, replace=True
40
+ )
41
+ print("Created credential: ", credential["credential_name"])
42
+
43
+
44
+ asyncio.run(main())
@@ -0,0 +1,32 @@
1
+ # -----------------------------------------------------------------------------
2
+ # Copyright (c) 2025, Oracle and/or its affiliates.
3
+ #
4
+ # Licensed under the Universal Permissive License v 1.0 as shown at
5
+ # http://oss.oracle.com/licenses/upl.
6
+ # -----------------------------------------------------------------------------
7
+
8
+ # -----------------------------------------------------------------------------
9
+ # async/delete_ai_credential
10
+ #
11
+ # Async API to delete credential
12
+ # -----------------------------------------------------------------------------
13
+
14
+ import asyncio
15
+ import os
16
+
17
+ import select_ai
18
+
19
+ user = os.getenv("SELECT_AI_USER")
20
+ password = os.getenv("SELECT_AI_PASSWORD")
21
+ dsn = os.getenv("SELECT_AI_DB_CONNECT_STRING")
22
+
23
+
24
+ async def main():
25
+ await select_ai.async_connect(user=user, password=password, dsn=dsn)
26
+ await select_ai.async_delete_credential(
27
+ credential_name="my_oci_ai_profile_key", force=True
28
+ )
29
+ print("Deleted credential: my_oci_ai_profile_key")
30
+
31
+
32
+ asyncio.run(main())
@@ -0,0 +1,33 @@
1
+ # -----------------------------------------------------------------------------
2
+ # Copyright (c) 2025, Oracle and/or its affiliates.
3
+ #
4
+ # Licensed under the Universal Permissive License v 1.0 as shown at
5
+ # http://oss.oracle.com/licenses/upl.
6
+ # -----------------------------------------------------------------------------
7
+
8
+ # -----------------------------------------------------------------------------
9
+ # async/disable_ai_provider.py
10
+ #
11
+ # Async API to disable AI provider for database users
12
+ # -----------------------------------------------------------------------------
13
+
14
+ import asyncio
15
+ import os
16
+
17
+ import select_ai
18
+
19
+ admin_user = os.getenv("SELECT_AI_ADMIN_USER")
20
+ password = os.getenv("SELECT_AI_ADMIN_PASSWORD")
21
+ dsn = os.getenv("SELECT_AI_DB_CONNECT_STRING")
22
+ select_ai_user = os.getenv("SELECT_AI_USER")
23
+
24
+
25
+ async def main():
26
+ await select_ai.async_connect(user=admin_user, password=password, dsn=dsn)
27
+ await select_ai.async_disable_provider(
28
+ users=select_ai_user, provider_endpoint="*.openai.azure.com"
29
+ )
30
+ print("Disabled AI provider for user: ", select_ai_user)
31
+
32
+
33
+ asyncio.run(main())
@@ -0,0 +1,33 @@
1
+ # -----------------------------------------------------------------------------
2
+ # Copyright (c) 2025, Oracle and/or its affiliates.
3
+ #
4
+ # Licensed under the Universal Permissive License v 1.0 as shown at
5
+ # http://oss.oracle.com/licenses/upl.
6
+ # -----------------------------------------------------------------------------
7
+
8
+ # -----------------------------------------------------------------------------
9
+ # async/enable_ai_provider.py
10
+ #
11
+ # Async API to enable AI provider for database users
12
+ # -----------------------------------------------------------------------------
13
+
14
+ import asyncio
15
+ import os
16
+
17
+ import select_ai
18
+
19
+ admin_user = os.getenv("SELECT_AI_ADMIN_USER")
20
+ password = os.getenv("SELECT_AI_ADMIN_PASSWORD")
21
+ dsn = os.getenv("SELECT_AI_DB_CONNECT_STRING")
22
+ select_ai_user = os.getenv("SELECT_AI_USER")
23
+
24
+
25
+ async def main():
26
+ await select_ai.async_connect(user=admin_user, password=password, dsn=dsn)
27
+ await select_ai.async_enable_provider(
28
+ users=select_ai_user, provider_endpoint="*.openai.azure.com"
29
+ )
30
+ print("Enabled AI provider for user: ", select_ai_user)
31
+
32
+
33
+ asyncio.run(main())
@@ -19,13 +19,12 @@ password = os.getenv("SELECT_AI_PASSWORD")
19
19
  dsn = os.getenv("SELECT_AI_DB_CONNECT_STRING")
20
20
 
21
21
 
22
- # This example shows how to asynchronously ask the LLM to explain SQL
23
22
  async def main():
24
23
  await select_ai.async_connect(user=user, password=password, dsn=dsn)
25
24
  async_profile = await select_ai.AsyncProfile(
26
25
  profile_name="async_oci_ai_profile",
27
26
  )
28
- response = await async_profile.explain_sql("How many promotions")
27
+ response = await async_profile.explain_sql("How many promotions ?")
29
28
  print(response)
30
29
 
31
30
 
@@ -0,0 +1,48 @@
1
+ # -----------------------------------------------------------------------------
2
+ # Copyright (c) 2025, Oracle and/or its affiliates.
3
+ #
4
+ # Licensed under the Universal Permissive License v 1.0 as shown at
5
+ # http://oss.oracle.com/licenses/upl.
6
+ # -----------------------------------------------------------------------------
7
+
8
+ # -----------------------------------------------------------------------------
9
+ # async/profile_gen_multi_table_synthetic_data.py
10
+ # -----------------------------------------------------------------------------
11
+
12
+ import asyncio
13
+ import os
14
+
15
+ import select_ai
16
+
17
+ user = os.getenv("SELECT_AI_USER")
18
+ password = os.getenv("SELECT_AI_PASSWORD")
19
+ dsn = os.getenv("SELECT_AI_DB_CONNECT_STRING")
20
+
21
+
22
+ async def main():
23
+ await select_ai.async_connect(user=user, password=password, dsn=dsn)
24
+ async_profile = await select_ai.AsyncProfile(
25
+ profile_name="async_oci_ai_profile",
26
+ )
27
+ synthetic_data_params = select_ai.SyntheticDataParams(
28
+ sample_rows=100, table_statistics=True, priority="HIGH"
29
+ )
30
+ object_list = [
31
+ {
32
+ "owner": user,
33
+ "name": "MOVIE",
34
+ "record_count": 100,
35
+ "user_prompt": "the release date for the movies should be in 2019",
36
+ },
37
+ {"owner": user, "name": "ACTOR", "record_count": 10},
38
+ {"owner": user, "name": "DIRECTOR", "record_count": 5},
39
+ ]
40
+ synthetic_data_attributes = select_ai.SyntheticDataAttributes(
41
+ object_list=object_list, params=synthetic_data_params
42
+ )
43
+ await async_profile.generate_synthetic_data(
44
+ synthetic_data_attributes=synthetic_data_attributes
45
+ )
46
+
47
+
48
+ asyncio.run(main())
@@ -0,0 +1,41 @@
1
+ # -----------------------------------------------------------------------------
2
+ # Copyright (c) 2025, Oracle and/or its affiliates.
3
+ #
4
+ # Licensed under the Universal Permissive License v 1.0 as shown at
5
+ # http://oss.oracle.com/licenses/upl.
6
+ # -----------------------------------------------------------------------------
7
+
8
+ # -----------------------------------------------------------------------------
9
+ # async/profile_gen_single_table_synthetic_data.py
10
+ # -----------------------------------------------------------------------------
11
+
12
+ import asyncio
13
+ import os
14
+
15
+ import select_ai
16
+
17
+ user = os.getenv("SELECT_AI_USER")
18
+ password = os.getenv("SELECT_AI_PASSWORD")
19
+ dsn = os.getenv("SELECT_AI_DB_CONNECT_STRING")
20
+
21
+
22
+ async def main():
23
+ await select_ai.async_connect(user=user, password=password, dsn=dsn)
24
+ async_profile = await select_ai.AsyncProfile(
25
+ profile_name="async_oci_ai_profile",
26
+ )
27
+ synthetic_data_params = select_ai.SyntheticDataParams(
28
+ sample_rows=100, table_statistics=True, priority="HIGH"
29
+ )
30
+ synthetic_data_attributes = select_ai.SyntheticDataAttributes(
31
+ object_name="MOVIE",
32
+ user_prompt="the release date for the movies should be in 2019",
33
+ params=synthetic_data_params,
34
+ record_count=100,
35
+ )
36
+ await async_profile.generate_synthetic_data(
37
+ synthetic_data_attributes=synthetic_data_attributes
38
+ )
39
+
40
+
41
+ asyncio.run(main())
@@ -28,7 +28,7 @@ async def main():
28
28
  profile_name="async_oci_ai_profile",
29
29
  )
30
30
  # run_sql returns a pandas df
31
- df = await async_profile.run_sql("How many promotions")
31
+ df = await async_profile.run_sql("How many promotions?")
32
32
  print(df)
33
33
 
34
34
 
@@ -26,7 +26,7 @@ async def main():
26
26
  async_profile = await select_ai.AsyncProfile(
27
27
  profile_name="async_oci_ai_profile",
28
28
  )
29
- response = await async_profile.show_sql("How many promotions")
29
+ response = await async_profile.show_sql("How many promotions?")
30
30
  print(response)
31
31
 
32
32
 
@@ -29,8 +29,8 @@ async def main():
29
29
  )
30
30
  sql_tasks = [
31
31
  async_profile.show_sql(prompt="How many customers?"),
32
- async_profile.run_sql(prompt="How many promotions"),
33
- async_profile.explain_sql(prompt="How many promotions"),
32
+ async_profile.run_sql(prompt="How many promotions?"),
33
+ async_profile.explain_sql(prompt="How many promotions?"),
34
34
  ]
35
35
 
36
36
  # Collect results from multiple asynchronous tasks
@@ -10,6 +10,7 @@
10
10
  #
11
11
  # Demonstrates context aware conversation using AI Profile
12
12
  # -----------------------------------------------------------------------------
13
+
13
14
  import os
14
15
 
15
16
  import select_ai
@@ -11,6 +11,7 @@
11
11
  # Create a new conversation given a title and description. The created
12
12
  # conversation can be used in profile.chat_session()
13
13
  # -----------------------------------------------------------------------------
14
+
14
15
  import os
15
16
 
16
17
  import select_ai
@@ -10,6 +10,7 @@
10
10
  #
11
11
  # Create a Database credential storing OCI Gen AI's credentials
12
12
  # -----------------------------------------------------------------------------
13
+
13
14
  import os
14
15
 
15
16
  import oci
@@ -0,0 +1,25 @@
1
+ # -----------------------------------------------------------------------------
2
+ # Copyright (c) 2025, Oracle and/or its affiliates.
3
+ #
4
+ # Licensed under the Universal Permissive License v 1.0 as shown at
5
+ # http://oss.oracle.com/licenses/upl.
6
+ # -----------------------------------------------------------------------------
7
+
8
+ # -----------------------------------------------------------------------------
9
+ # delete_ai_credential.py
10
+ #
11
+ # Delete AI credential
12
+ # -----------------------------------------------------------------------------
13
+ import os
14
+
15
+ import select_ai
16
+
17
+ user = os.getenv("SELECT_AI_USER")
18
+ password = os.getenv("SELECT_AI_PASSWORD")
19
+ dsn = os.getenv("SELECT_AI_DB_CONNECT_STRING")
20
+
21
+ select_ai.connect(user=user, password=password, dsn=dsn)
22
+ select_ai.delete_credential(
23
+ credential_name="my_oci_ai_profile_key", force=True
24
+ )
25
+ print("Deleted credential: my_oci_ai_profile_key")
@@ -23,6 +23,6 @@ profile = select_ai.Profile(
23
23
  )
24
24
  print(profile.description)
25
25
  explanation = profile.explain_sql(
26
- prompt="How many promotions are there in the sh database?"
26
+ prompt="How many promotions are there in the database?"
27
27
  )
28
28
  print(explanation)
@@ -24,6 +24,6 @@ profile = select_ai.Profile(
24
24
  profile_name="oci_ai_profile",
25
25
  )
26
26
  narration = profile.narrate(
27
- prompt="How many promotions are there in the sh database?"
27
+ prompt="How many promotions are there in the database?"
28
28
  )
29
29
  print(narration)
@@ -22,7 +22,7 @@ dsn = os.getenv("SELECT_AI_DB_CONNECT_STRING")
22
22
  select_ai.connect(user=user, password=password, dsn=dsn)
23
23
  profile = select_ai.Profile(profile_name="oci_ai_profile")
24
24
  df = profile.run_sql(
25
- prompt="How many promotions are there in the sh database?"
25
+ prompt="How many promotions are there in the database?"
26
26
  )
27
27
  print(df.columns)
28
28
  print(df)
@@ -22,6 +22,6 @@ dsn = os.getenv("SELECT_AI_DB_CONNECT_STRING")
22
22
  select_ai.connect(user=user, password=password, dsn=dsn)
23
23
  profile = select_ai.Profile(profile_name="oci_ai_profile")
24
24
  sql = profile.show_sql(
25
- prompt="How many promotions are there in the sh database?"
25
+ prompt="How many promotions are there in the database?"
26
26
  )
27
27
  print(sql)
@@ -6,11 +6,6 @@
6
6
  # -----------------------------------------------------------------------------
7
7
 
8
8
  from .action import Action
9
- from .admin import (
10
- create_credential,
11
- disable_provider,
12
- enable_provider,
13
- )
14
9
  from .async_profile import AsyncProfile
15
10
  from .base_profile import BaseProfile, ProfileAttributes
16
11
  from .conversation import (
@@ -18,6 +13,12 @@ from .conversation import (
18
13
  Conversation,
19
14
  ConversationAttributes,
20
15
  )
16
+ from .credential import (
17
+ async_create_credential,
18
+ async_delete_credential,
19
+ create_credential,
20
+ delete_credential,
21
+ )
21
22
  from .db import (
22
23
  async_connect,
23
24
  async_cursor,
@@ -39,6 +40,10 @@ from .provider import (
39
40
  OCIGenAIProvider,
40
41
  OpenAIProvider,
41
42
  Provider,
43
+ async_disable_provider,
44
+ async_enable_provider,
45
+ disable_provider,
46
+ enable_provider,
42
47
  )
43
48
  from .synthetic_data import (
44
49
  SyntheticDataAttributes,