Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@
}

project = "Select AI for Python"
copyright = "2025, Oracle and/or its affiliates. All rights reserved."
copyright = "2026, Oracle and/or its affiliates. All rights reserved."
author = "Oracle"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ["sphinx.ext.autodoc", "sphinx_toolbox.latex"]
extensions = [
"sphinx.ext.autodoc",
"sphinx_toolbox.latex",
"sphinx.ext.autosectionlabel",
]

autosectionlabel_prefix_document = True

# The suffix of source filenames.
source_suffix = ".rst"
Expand Down
35 changes: 35 additions & 0 deletions doc/source/user_guide/connection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,41 @@ with ``await`` keyword:
await select_ai.async_connect(user=user, password=password, dsn=dsn)


Connection Pool
===============

You can create a connection pool using the ``select_ai.create_pool``
and ``select_ai.create_pool_async`` methods

.. code-block:: python

import select_ai

user = "<your_db_user>"
password = "<your_db_password>"
dsn = "<your_db_dsn>"

# for sync pool
select_ai.create_pool(
user=user,
password=password,
dsn=dsn,
min_size=5,
max_size=10,
increment=5
)
# for async pool
select_ai.create_pool_async(
user=user,
password=password,
dsn=dsn,
min_size=5,
max_size=10,
increment=5
)

Check this `blog <https://blogs.oracle.com/machinelearning/boosting-select-ai-for-python-concurrency-with-connection-pooling>`__ which shows the benefit of connection pooling along with FastAPI service

.. note::

For m-TLS (wallet) based connection, additional parameters like
Expand Down
16 changes: 8 additions & 8 deletions doc/source/user_guide/provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ for the supported providers
Enable AI service provider
**************************

Sync API
++++++++
Enable using Sync API
+++++++++++++++++++++

This method adds ACL allowing database users to invoke AI provider's
HTTP endpoint
Expand All @@ -103,8 +103,8 @@ output::

.. latex:clearpage::
Async API
+++++++++
Enable using Async API
++++++++++++++++++++++
.. literalinclude:: ../../../samples/async/enable_ai_provider.py
:language: python
:lines: 14-
Expand All @@ -122,8 +122,8 @@ Disable AI service provider
This method removes ACL blocking database users to invoke AI provider's
HTTP endpoint

Sync API
++++++++
Disable using Sync API
++++++++++++++++++++++

.. literalinclude:: ../../../samples/disable_ai_provider.py
:language: python
Expand All @@ -135,8 +135,8 @@ output::

.. latex:clearpage::
Async API
+++++++++
Disable using Async API
+++++++++++++++++++++++

.. literalinclude:: ../../../samples/async/disable_ai_provider.py
:language: python
Expand Down
16 changes: 8 additions & 8 deletions doc/source/user_guide/synthetic_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Single table synthetic data

The below example shows single table synthetic data generation

Sync API
++++++++
Single Table Sync API
+++++++++++++++++++++

.. literalinclude:: ../../../samples/profile_gen_single_table_synthetic_data.py
:language: python
Expand All @@ -44,8 +44,8 @@ output::

.. latex:clearpage::

Async API
+++++++++
Singe Table Async API
+++++++++++++++++++++

.. literalinclude:: ../../../samples/async/profile_gen_single_table_synthetic_data.py
:language: python
Expand All @@ -68,8 +68,8 @@ Multi table synthetic data

The below example shows multitable synthetic data generation

Sync API
++++++++
Multi table Sync API
++++++++++++++++++++

.. literalinclude:: ../../../samples/profile_gen_multi_table_synthetic_data.py
:language: python
Expand Down Expand Up @@ -97,8 +97,8 @@ output::
300


Async API
+++++++++
Multi table Async API
+++++++++++++++++++++


.. literalinclude:: ../../../samples/async/profile_gen_multi_table_synthetic_data.py
Expand Down
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: b87d5f8ed0634472678ff572d56d38cc
config: 04c93cb781f3bb6be839c34359e8a2a4
tags: 645f666f9bcd5a90fca523b33c5a78b7
35 changes: 35 additions & 0 deletions docs/_sources/user_guide/connection.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,41 @@ with ``await`` keyword:
await select_ai.async_connect(user=user, password=password, dsn=dsn)


Connection Pool
===============

You can create a connection pool using the ``select_ai.create_pool``
and ``select_ai.create_pool_async`` methods

.. code-block:: python

import select_ai

user = "<your_db_user>"
password = "<your_db_password>"
dsn = "<your_db_dsn>"

# for sync pool
select_ai.create_pool(
user=user,
password=password,
dsn=dsn,
min_size=5,
max_size=10,
increment=5
)
# for async pool
select_ai.create_pool_async(
user=user,
password=password,
dsn=dsn,
min_size=5,
max_size=10,
increment=5
)

Check this `blog <https://blogs.oracle.com/machinelearning/boosting-select-ai-for-python-concurrency-with-connection-pooling>`__ which shows the benefit of connection pooling along with FastAPI service

.. note::

For m-TLS (wallet) based connection, additional parameters like
Expand Down
16 changes: 8 additions & 8 deletions docs/_sources/user_guide/provider.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ for the supported providers
Enable AI service provider
**************************

Sync API
++++++++
Enable using Sync API
+++++++++++++++++++++

This method adds ACL allowing database users to invoke AI provider's
HTTP endpoint
Expand All @@ -103,8 +103,8 @@ output::

.. latex:clearpage::
Async API
+++++++++
Enable using Async API
++++++++++++++++++++++
.. literalinclude:: ../../../samples/async/enable_ai_provider.py
:language: python
:lines: 14-
Expand All @@ -122,8 +122,8 @@ Disable AI service provider
This method removes ACL blocking database users to invoke AI provider's
HTTP endpoint

Sync API
++++++++
Disable using Sync API
++++++++++++++++++++++

.. literalinclude:: ../../../samples/disable_ai_provider.py
:language: python
Expand All @@ -135,8 +135,8 @@ output::

.. latex:clearpage::
Async API
+++++++++
Disable using Async API
+++++++++++++++++++++++

.. literalinclude:: ../../../samples/async/disable_ai_provider.py
:language: python
Expand Down
16 changes: 8 additions & 8 deletions docs/_sources/user_guide/synthetic_data.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Single table synthetic data

The below example shows single table synthetic data generation

Sync API
++++++++
Single Table Sync API
+++++++++++++++++++++

.. literalinclude:: ../../../samples/profile_gen_single_table_synthetic_data.py
:language: python
Expand All @@ -44,8 +44,8 @@ output::

.. latex:clearpage::

Async API
+++++++++
Singe Table Async API
+++++++++++++++++++++

.. literalinclude:: ../../../samples/async/profile_gen_single_table_synthetic_data.py
:language: python
Expand All @@ -68,8 +68,8 @@ Multi table synthetic data

The below example shows multitable synthetic data generation

Sync API
++++++++
Multi table Sync API
++++++++++++++++++++

.. literalinclude:: ../../../samples/profile_gen_multi_table_synthetic_data.py
:language: python
Expand Down Expand Up @@ -97,8 +97,8 @@ output::
300


Async API
+++++++++
Multi table Async API
+++++++++++++++++++++


.. literalinclude:: ../../../samples/async/profile_gen_multi_table_synthetic_data.py
Expand Down
6 changes: 6 additions & 0 deletions docs/_static/copybutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ const loadCopyButton = () => {
+ ".highlight-python3 .highlight,"
+ ".highlight-pycon .highlight,"
+ ".highlight-pycon3 .highlight,"
+ ".highlight-bash .highlight,"
+ ".highlight-console .highlight,"
+ ".highlight-doscon .highlight,"
+ ".highlight-ps1con .highlight,"
+ ".highlight-sh .highlight,"
+ ".highlight-shell-session .highlight,"
+ ".highlight-default .highlight"
)

Expand Down
2 changes: 1 addition & 1 deletion docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '1.2.2',
VERSION: '1.3.0',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
49 changes: 49 additions & 0 deletions docs/_static/pydoctheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,25 @@ div.body {
}
}

div.code-block-caption {
background-color: #eee;
border: 1px solid #ac9;
border-bottom: none;
border-radius: 3px 3px 0 0;
padding: 0.3em 0.6em;
font-size: 90%;
color: #333;

& + div pre {
border-top-left-radius: 0 !important;
border-top-right-radius: 0 !important;
}

& + div .copybutton {
border-top-right-radius: 0 !important;
}
}

/* Admonitions */
:root {
--admonition-background: #eee;
Expand Down Expand Up @@ -425,6 +444,36 @@ div.footer a:hover {
color: #229;
}

/* C API thread safety annotations */
:root {
--threadsafety-incompatible: var(--bad-color);
--threadsafety-compatible: var(--middle-color);
--threadsafety-distinct: var(--middle-color);
--threadsafety-shared: var(--good-color);
--threadsafety-atomic: var(--good-color);
}

.threadsafety.threadsafety-incompatible {
color: var(--threadsafety-incompatible);
}

.threadsafety.threadsafety-compatible {
color: var(--threadsafety-compatible);
}

.threadsafety.threadsafety-distinct {
color: var(--threadsafety-distinct);
}

.threadsafety.threadsafety-shared {
color: var(--threadsafety-shared);
}

.threadsafety.threadsafety-atomic {
color: var(--threadsafety-atomic);
}


dl > dt span ~ em,
.sig {
font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace;
Expand Down
6 changes: 6 additions & 0 deletions docs/_static/pydoctheme_dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ div.body pre {
border-color: #616161;
}

div.code-block-caption {
background-color: #333;
border-color: #616161;
color: white;
}

code {
background-color: #424242;
}
Expand Down
Loading