Skip to content

Commit fe7b554

Browse files
committed
Updated docs and samples
1 parent e1829b6 commit fe7b554

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+445
-363
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
recursive-include tests *.py
2+
recursive-include samples *.py

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ python3 -m pip install select_ai
1111

1212
## Samples
1313

14-
Examples can be found in the examples directory
14+
Examples can be found in the samples directory
3.13 KB
Loading

doc/source/image/vector_index.png

-24.2 KB
Loading

doc/source/index.rst

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,6 @@ Getting Started
2222
user_guide/installation.rst
2323
user_guide/connection.rst
2424

25-
AI Profile Object Model
26-
==============================
27-
28-
.. toctree::
29-
:numbered:
30-
:maxdepth: 3
31-
32-
user_guide/profile_provider_class.rst
33-
34-
VectorIndex Object Model
35-
==================================
36-
37-
.. toctree::
38-
:numbered:
39-
:maxdepth: 3
40-
41-
user_guide/vector_index_class.rst
42-
43-
Conversation Object Model
44-
===================================
45-
46-
.. toctree::
47-
:numbered:
48-
:maxdepth: 3
49-
50-
user_guide/conversation_class.rst
5125

5226
Actions
5327
=======
@@ -67,6 +41,15 @@ Provider
6741

6842
user_guide/provider.rst
6943

44+
Credential
45+
==========
46+
47+
.. toctree::
48+
:numbered:
49+
:maxdepth: 3
50+
51+
user_guide/credential.rst
52+
7053

7154
Profile Attributes
7255
==================
@@ -87,14 +70,15 @@ Profile
8770
user_guide/profile.rst
8871

8972

90-
Async Profile
91-
=============
73+
Conversation
74+
============
9275

9376
.. toctree::
9477
:numbered:
9578
:maxdepth: 3
9679

97-
user_guide/async_profile.rst
80+
user_guide/conversation.rst
81+
9882

9983
Vector Index
10084
============
@@ -113,12 +97,3 @@ Synthetic Data
11397
:maxdepth: 3
11498

11599
user_guide/synthetic_data.rst
116-
117-
Conversation
118-
============
119-
120-
.. toctree::
121-
:numbered:
122-
:maxdepth: 3
123-
124-
user_guide/conversation.rst

doc/source/user_guide/actions.rst

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
11
.. _actions:
22

3+
An action in Select AI is a keyword that instructs Select AI to perform different behavior when acting on the prompt.
4+
35
********************
4-
Supported AI Actions
6+
Supported Actions
57
********************
68

79
Following list of actions can be performed using ``select_ai``
810

9-
- ``select_ai.Action.CHAT``
10-
- ``select_ai.Action.EXPLAINSQL``
11-
- ``select_ai.Action.NARRATE``
12-
- ``select_ai.Action.RUNSQL``
13-
- ``select_ai.Action.SHOWPROMPT``
14-
- ``select_ai.Action.SHOWSQL``
11+
.. list-table:: Select AI Actions
12+
:header-rows: 1
13+
:widths: 20 30 50
14+
:align: left
15+
16+
* - Actions
17+
- Enum
18+
- Description
19+
* - chat
20+
- ``select_ai.Action.CHAT``
21+
- Enables general conversations with the LLM, potentially for clarifying prompts, exploring data, or generating content.
22+
* - explainsql
23+
- ``select_ai.Action.EXPLAINSQL``
24+
- Explain the generated SQL query
25+
* - narrate
26+
- ``select_ai.Action.NARRATE``
27+
- Explains the output of the query in natural language, making the results accessible to users without deep technical expertise.
28+
* - runsql
29+
- ``select_ai.Action.RUNSQL``
30+
- Executes a SQL query generated from a natural language prompt. This is the default action.
31+
* - showprompt
32+
- ``select_ai.Action.SHOWPROMPT``
33+
- Show the details of the prompt sent to LLM
34+
* - showsql
35+
- ``select_ai.Action.SHOWSQL``
36+
- Displays the generated SQL statement without executing it.

doc/source/user_guide/async_profile.rst

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ used with ``await``.
1616
Async Profile creation
1717
***********************
1818

19-
.. literalinclude:: ../../../examples/async_examples/profile_create.py
19+
.. literalinclude:: ../../../samples/async_samples/profile_create.py
2020
:language: python
2121

2222
output::
@@ -54,7 +54,7 @@ output::
5454
Async explain SQL
5555
***********************
5656

57-
.. literalinclude:: ../../../examples/async_examples/profile_explain_sql.py
57+
.. literalinclude:: ../../../samples/async_samples/profile_explain_sql.py
5858
:language: python
5959

6060
output::
@@ -82,7 +82,7 @@ output::
8282
Async run SQL
8383
***********************
8484

85-
.. literalinclude:: ../../../examples/async_examples/profile_run_sql.py
85+
.. literalinclude:: ../../../samples/async_samples/profile_run_sql.py
8686
:language: python
8787

8888
output::
@@ -94,7 +94,7 @@ output::
9494
Async show SQL
9595
***********************
9696

97-
.. literalinclude:: ../../../examples/async_examples/profile_show_sql.py
97+
.. literalinclude:: ../../../samples/async_samples/profile_show_sql.py
9898
:language: python
9999

100100
output::
@@ -106,7 +106,7 @@ output::
106106
Async concurrent SQL
107107
***********************
108108

109-
.. literalinclude:: ../../../examples/async_examples/profile_sql_concurrent_tasks.py
109+
.. literalinclude:: ../../../samples/async_samples/profile_sql_concurrent_tasks.py
110110
:language: python
111111

112112
output::
@@ -139,7 +139,7 @@ output::
139139
Async chat
140140
**********
141141

142-
.. literalinclude:: ../../../examples/async_examples/profile_chat.py
142+
.. literalinclude:: ../../../samples/async_samples/profile_chat.py
143143
:language: python
144144

145145
output::
@@ -162,7 +162,7 @@ output::
162162
Async pipeline
163163
*********************
164164

165-
.. literalinclude:: ../../../examples/async_examples/profile_pipeline.py
165+
.. literalinclude:: ../../../samples/async_samples/profile_pipeline.py
166166
:language: python
167167

168168
output::
@@ -192,11 +192,9 @@ output::
192192
List profiles asynchronously
193193
****************************
194194

195-
.. literalinclude:: ../../../examples/async_examples/profiles_list.py
195+
.. literalinclude:: ../../../samples/async_samples/profiles_list.py
196196
:language: python
197197

198198
output::
199199

200-
AsyncProfile(profile_name=OCI_VECTOR_AI_PROFILE, attributes=ProfileAttributes(annotations=None, case_sensitive_values=None, comments=None, constraints=None, conversation=None, credential_name='my_oci_ai_profile_key', enable_sources=None, enable_source_offsets=None, enforce_object_list=None, max_tokens=1024, object_list=None, object_list_mode=None, provider=OCIGenAIProvider(embedding_model=None, model=None, provider_name='oci', provider_endpoint=None, region='us-chicago-1', oci_apiformat='GENERIC', oci_compartment_id=None, oci_endpoint_id=None, oci_runtimetype=None), seed=None, stop_tokens=None, streaming=None, temperature=None, vector_index_name='test_vector_index'), description=<oracledb.AsyncLOB object at 0x1056de150>)
201-
AsyncProfile(profile_name=OCI_GEN_AI_PROFILE, attributes=ProfileAttributes(annotations=None, case_sensitive_values=None, comments=None, constraints=None, conversation=None, credential_name='my_oci_ai_profile_key', enable_sources=None, enable_source_offsets=None, enforce_object_list=None, max_tokens=1024, object_list=None, object_list_mode=None, provider=OCIGenAIProvider(embedding_model=None, model=None, provider_name='oci', provider_endpoint=None, region='us-chicago-1', oci_apiformat='COHERE', oci_compartment_id=None, oci_endpoint_id=None, oci_runtimetype=None), seed=None, stop_tokens=None, streaming=None, temperature=None, vector_index_name=None), description=<oracledb.AsyncLOB object at 0x104b1f170>)
202-
AsyncProfile(profile_name=OCI_AI_PROFILE, attributes=ProfileAttributes(annotations=None, case_sensitive_values=None, comments=None, constraints=None, conversation=None, credential_name='my_oci_ai_profile_key', enable_sources=None, enable_source_offsets=None, enforce_object_list=None, max_tokens=1024, object_list=[{'owner': 'SH'}], object_list_mode=None, provider=OCIGenAIProvider(embedding_model=None, model=None, provider_name='oci', provider_endpoint=None, region='us-chicago-1', oci_apiformat='GENERIC', oci_compartment_id=None, oci_endpoint_id=None, oci_runtimetype=None), seed=None, stop_tokens=None, streaming=None, temperature=None, vector_index_name=None), description=<oracledb.AsyncLOB object at 0x102625940>)
200+
OCI_AI_PROFILE

doc/source/user_guide/connection.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ To connect to an Oracle Database synchronously, use
1818
.. code-block:: python
1919
2020
import select_ai
21+
2122
user = "<your_db_user>"
2223
password = "<your_db_password>"
2324
dsn = "<your_db_dsn>"
@@ -34,6 +35,7 @@ with ``await`` keyword:
3435
.. code-block:: python
3536
3637
import select_ai
38+
3739
user = "<your_db_user>"
3840
password = "<your_db_password>"
3941
dsn = "<your_db_dsn>"

doc/source/user_guide/conversation.rst

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
.. _conversation:
22

3-
********************
4-
``Conversation``
5-
********************
6-
7-
.. autoclass:: select_ai.Conversation
8-
:members:
3+
Conversations in Select AI represent an interactive exchange between the user and the system, enabling users to query or interact with the database through a series of natural language prompts.
94

10-
*********************
11-
``AsyncConversation``
12-
*********************
13-
14-
.. autoclass:: select_ai.AsyncConversation
15-
:members:
5+
*****************************
6+
``Conversation Object model``
7+
*****************************
8+
.. _conversationfig:
9+
.. figure:: /image/conversation.png
10+
:alt: Select AI Conversation
1611

1712
**************************
1813
``ConversationAttributes``
@@ -21,14 +16,18 @@
2116
.. autoclass:: select_ai.ConversationAttributes
2217
:members:
2318

24-
************
25-
Conversation
26-
************
19+
20+
********************
21+
``Conversation`` API
22+
********************
23+
24+
.. autoclass:: select_ai.Conversation
25+
:members:
2726

2827
Create conversion
2928
++++++++++++++++++
3029

31-
.. literalinclude:: ../../../examples/conversation_create.py
30+
.. literalinclude:: ../../../samples/conversation_create.py
3231
:language: python
3332

3433
output::
@@ -38,7 +37,7 @@ output::
3837
Chat session
3938
+++++++++++++
4039

41-
.. literalinclude:: ../../../examples/conversation_chat_session.py
40+
.. literalinclude:: ../../../samples/conversation_chat_session.py
4241
:language: python
4342

4443
output::
@@ -59,7 +58,7 @@ output::
5958
List conversations
6059
++++++++++++++++++
6160

62-
.. literalinclude:: ../../../examples/conversations_list.py
61+
.. literalinclude:: ../../../samples/conversations_list.py
6362
:language: python
6463

6564
output::
@@ -74,23 +73,27 @@ output::
7473
Delete conversation
7574
+++++++++++++++++++
7675

77-
.. literalinclude:: ../../../examples/conversation_delete.py
76+
.. literalinclude:: ../../../samples/conversation_delete.py
7877
:language: python
7978

8079
output::
8180

8281
Deleted conversation with conversation id: 37DDC22E-11C8-3D49-E063-D81A000A85FE
8382

8483

85-
*********************
86-
Async conversation
87-
*********************
8884

85+
*************************
86+
``AsyncConversation`` API
87+
*************************
8988

90-
Chat Session
91-
+++++++++++++
89+
.. autoclass:: select_ai.AsyncConversation
90+
:members:
9291

93-
.. literalinclude:: ../../../examples/async_examples/conversation_chat_session.py
92+
93+
Async chat session
94+
++++++++++++++++++
95+
96+
.. literalinclude:: ../../../samples/async_samples/conversation_chat_session.py
9497
:language: python
9598

9699
output::
@@ -108,10 +111,10 @@ output::
108111
...
109112
...
110113

111-
List conversations
112-
++++++++++++++++++
114+
Async list conversations
115+
++++++++++++++++++++++++
113116

114-
.. literalinclude:: ../../../examples/async_examples/conversations_list.py
117+
.. literalinclude:: ../../../samples/async_samples/conversations_list.py
115118
:language: python
116119

117120
output::

doc/source/user_guide/conversation_class.rst

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)