Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0d9c5f3
Initial commit
aosingh May 20, 2025
93f3e71
pre-commit hooks
aosingh May 20, 2025
62e7514
Added Sphinx docs and autodocs
aosingh May 21, 2025
e210728
Fixed bug for enum, docs update and added set_attributes
aosingh May 31, 2025
40b4ea0
refactoring of APIs
aosingh Jun 9, 2025
7c37644
Merge branch 'refactor/api_design' into 'main'
aosingh Jun 9, 2025
c7d9932
Added detailed documentation and examples
aosingh Jun 11, 2025
2f28b32
Merge branch 'refactor/api_design' into 'main'
aosingh Jun 11, 2025
e7a28db
Added async explain_sql API
aosingh Jun 11, 2025
d565d81
pin down pandas version and classifiers
aosingh Jun 11, 2025
a2d0e95
regenerate classes and doc update
aosingh Jun 11, 2025
b36dead
Updated samples
aosingh Jun 11, 2025
8bce4a6
Updated examples and API
aosingh Jul 8, 2025
0d98f99
Include tests in source distribution
aosingh Jul 10, 2025
28ed7a8
Merge branch 'package-test' into 'main'
aosingh Jul 10, 2025
6787776
Added license.txt, copyright notice and Third party license txt
aosingh Jul 11, 2025
b2ab94a
Added copyright notices to samples
aosingh Jul 11, 2025
6ccbd14
Merge branch 'corparch' into 'main'
aosingh Jul 11, 2025
df263fb
Added license classifier in pyproject.toml
aosingh Jul 12, 2025
e1829b6
Merge branch 'corparch' into 'main'
aosingh Jul 12, 2025
fe7b554
Updated docs and samples
aosingh Jul 21, 2025
f90e9f5
Merge branch 'doc/v1.0.0.dev4' into 'main'
aosingh Jul 21, 2025
629da86
Simplifed doc and bug fixes
aosingh Jul 23, 2025
9e3a834
1.0.0dev6 bug fixes and doc updates
aosingh Aug 5, 2025
8af166c
Updated samples
aosingh Aug 6, 2025
36d7a28
Update doc source
aosingh Aug 6, 2025
22960c5
default match pattern is .*
aosingh Aug 6, 2025
470d560
Merge branch 'v1.0.0.dev6' into 'main'
aosingh Aug 6, 2025
f9c6f96
Resolved merge conflicts
aosingh Aug 11, 2025
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
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
my_examples
.idea
.venv
.DS_Store
select_ai.egg-info
dist
.ruff_cache
src/select_ai.egg-info
doc/.DS_Store
doc/build
doc/drawio
**/__pycache__
test.env
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=600']
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
hooks:
- id: ruff
args: ["check", "--select", "I", "--fix"]
24 changes: 22 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
*Detailed instructions on how to contribute to the project, if applicable. Must include section about Oracle Contributor Agreement with link and instructions*

# Contributing to this repository

We welcome your contributions! There are multiple ways to contribute.
Expand Down Expand Up @@ -48,6 +46,28 @@ can be accepted.
your changes. Ensure that you reference the issue you created as well.
1. We will assign the pull request to 2-3 people for review before it is merged.



### Install development dependencies

```bash
python3 -m venv .venv
source .venv/bin/activate

python3 -m pip install --upgrade pip setuptools build pre-commit

python3 -m pip install -e . # installs project in editable mode

pre-commit install # install git hooks
pre-commit run --all-files
```

### Build

```bash
python -m build
```

## Code of conduct

Follow the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule). If you'd
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 Oracle and/or its affiliates.
Copyright (c) 2025, Oracle and/or its affiliates.

The Universal Permissive License (UPL), Version 1.0

Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-include tests *.py
recursive-include samples *.py
32 changes: 11 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
*This repository acts as a template for all of Oracle’s GitHub repositories. It contains information about the guidelines for those repositories. All files and sections contained in this template are mandatory, and a GitHub app ensures alignment with these guidelines. To get started with a new repository, replace the italic paragraphs with the respective text for your project.*
# Select AI for Python

# Project name

*Describe your project's features, functionality and target audience*
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.

## Installation

*Provide detailed step-by-step installation instructions. You can name this section **How to Run** or **Getting Started** instead of **Installation** if that's more acceptable for your project*

## Documentation
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.

*Developer-oriented documentation can be published on GitHub, but all product documentation must be published on <https://docs.oracle.com>*

## Examples
## Installation

*Describe any included examples or provide a link to a demo/tutorial*
Run
```bash
python3 -m pip install select_ai
```

## Help
## Samples

*Inform users on where to get help or how to receive official support from Oracle (if applicable)*
Examples can be found in the samples directory

## Contributing

*If your project has specific contribution requirements, update the CONTRIBUTING.md file to ensure those requirements are clearly explained*

This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md)

Expand All @@ -32,13 +28,7 @@ Please consult the [security guide](./SECURITY.md) for our responsible security

## License

*The correct copyright notice format for both documentation and software is*
"Copyright (c) [year,] year Oracle and/or its affiliates."
*You must include the year the content was first released (on any platform) and the most recent year in which it was revised*

Copyright (c) 2023 Oracle and/or its affiliates.

*Replace this statement if your project is not licensed under the UPL*
Copyright (c) 2025 Oracle and/or its affiliates.

Released under the Universal Permissive License v1.0 as shown at
<https://oss.oracle.com/licenses/upl/>.
37 changes: 37 additions & 0 deletions THIRD_PARTY_LICENSES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Third Party Dependencies:
=========================

pandas
======

BSD 3-Clause License

Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
All rights reserved.

Copyright (c) 2011-2025, Open source contributors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 changes: 31 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

.PHONY: html
html:
@$(SPHINXBUILD) -M html $(SOURCEDIR) $(BUILDDIR) $(SPHINXOPTS)

.PHONY: epub
epub:
@$(SPHINXBUILD) -M epub $(SOURCEDIR) $(BUILDDIR) $(SPHINXOPTS)

.PHONY: pdf
pdf:
@$(SPHINXBUILD) -M latexpdf $(SOURCEDIR) $(BUILDDIR) $(SPHINXOPTS)

.PHONY: clean
clean:
rm -rf $(BUILDDIR)/*
24 changes: 24 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Sphinx is used to generate documentation

```text
python -m pip install -r requirements.txt
```

For more information on Sphinx, please visit this page:

http://www.sphinx-doc.org

Once Sphinx is installed, the supplied Makefile can be used to build the
different targets, for example to build the HTML documentation, run::

make

To make ePub documentation, run::

make epub

To make PDF documentation, run::

make pdf

The program ``latexmk`` may be required by Sphinx to generate PDF output.
3 changes: 3 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx
sphinx-rtd-theme
sphinx_toolbox
58 changes: 58 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import os
import sys

import sphinx_prompt

sys.modules["sphinx-prompt"] = sphinx_prompt

sys.path.insert(0, os.path.join("..", "..", "src", "select_ai"))

autodocs_default_options = {
"members": True,
"inherited-members": True,
"undoc-members": True,
}

project = "Select AI for Python"
copyright = "2025, 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"]

# The suffix of source filenames.
source_suffix = ".rst"

# The root toctree document.
root_doc = master_doc = "index"


templates_path = ["_templates"]
exclude_patterns = []
global_vars = {}
local_vars = {}

version_file_name = os.path.join("..", "..", "src", "select_ai", "version.py")
with open(version_file_name) as f:
exec(f.read(), global_vars, local_vars)
version = ".".join(local_vars["__version__"].split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = local_vars["__version__"]


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]

pygments_style = "sphinx"
Binary file added doc/source/image/conversation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/image/profile_provider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/image/vector_index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 99 additions & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
.. Python API for Select AI documentation master file, created by
sphinx-quickstart on Thu May 15 08:17:49 2025.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

select_ai documentation
======================================

``select_ai`` is a Python module which enables integrating `DBMS_CLOUD_AI <https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/dbms-cloud-ai-package.html>`__
``PL/SQL`` package into Python workflows. It bridges the gap between ``PL/SQL`` package's AI capabilities
and Python's rich ecosystem.


Getting Started
===============

.. toctree::
:numbered:
:maxdepth: 3

user_guide/introduction.rst
user_guide/installation.rst
user_guide/connection.rst


Actions
=======

.. toctree::
:numbered:
:maxdepth: 3

user_guide/actions.rst

Provider
========

.. toctree::
:numbered:
:maxdepth: 3

user_guide/provider.rst

Credential
==========

.. toctree::
:numbered:
:maxdepth: 3

user_guide/credential.rst


Profile Attributes
==================

.. toctree::
:numbered:
:maxdepth: 3

user_guide/profile_attributes.rst

Profile
==================

.. toctree::
:numbered:
:maxdepth: 3

user_guide/profile.rst


Conversation
============

.. toctree::
:numbered:
:maxdepth: 3

user_guide/conversation.rst


Vector Index
============

.. toctree::
:numbered:
:maxdepth: 3

user_guide/vector_index.rst

Synthetic Data
==============

.. toctree::
:numbered:
:maxdepth: 3

user_guide/synthetic_data.rst
Loading