Skip to content

Commit 0e08946

Browse files
committed
Enhance documentation for Continue
1 parent 195e5d7 commit 0e08946

File tree

12 files changed

+90
-5
lines changed

12 files changed

+90
-5
lines changed

src/content/docs/extensions/db2i/AI/Continue/Continue.mdx

Lines changed: 90 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Once you have the extension installed, you can configure the AI provider you wan
2828

2929
For demonstration purposes, we will use the Ollama Provider for hosting LLMs locally on your machine.
3030

31+
3132
### Setting up Ollama Provider
3233

3334
Here is a step-by-step guide to setting up the Ollama provider with the IBM Granite models in Continue:
@@ -64,16 +65,100 @@ save this file and select the Granite model in the chat window.
6465

6566
![alt text](image-16.png)
6667

67-
### Examples
68+
### Other LLM Providers
69+
70+
You can also use other LLM providers with Continue. Here are some of the available providers:
71+
- Watsonx
72+
- Anthropic
73+
- OpenAI
74+
- Gemini (Google)
75+
76+
<Aside type="note">
77+
Although most models are good with SQL, some models are better that others. Here are some other models that work well with the Db2 for i assistant:
78+
- Llama3.3
79+
- Claude 3.5
80+
- Claude 3.7
81+
- Mistral Large
82+
83+
You can find more information for setting up additional models in Continue's [documentation](https://docs.continue.dev/customize/model-providers).
84+
</Aside>
85+
86+
87+
## Examples
6888

6989
Once you have the extension installed and the AI provider configured, you can ask questions about your database using the chat window using the `@db2i` context provider. In Continue, a context provider is very similar to a chat participant in GitHub Copilot. It provides additional context to the AI model to help it generate more accurate SQL queries.
7090

7191
More on context providers can be found [here](https://docs.continue.dev/customize/context-providers/).
7292

73-
**Example 1:** Summarize the columns in the `EMPLOYEE` table
93+
### Working with Tables
94+
95+
#### Example 1: Summarize the columns in the `EMPLOYEE` table
96+
97+
![alt text](image-1.png)
98+
99+
**Notes:**
100+
- The AI model recognizes the table reference `EMPLOYEE` and provides a summary of the columns in the table.
101+
- Primary Key and Constraint information is also provided.
102+
103+
104+
#### Example 2: Join the `EMPLOYEE` and `DEPARTMENT` tables
105+
106+
![alt text](image-2.png)
107+
108+
**Notes:**
109+
- The AI model recognizes the table references `EMPLOYEE` and `DEPARTMENT` and provides a SQL query that joins the two tables.
110+
- The SQL query is generated based on the context provided by the `@db2i` context provider.
111+
- The generated SQL query can be copied and run in the SQL editor in VS Code.
112+
113+
114+
#### Example 3: More complex queries
115+
![alt text](image-3.png)
116+
117+
**Notes:**
118+
- The AI model recognizes the table references `EMPLOYEE` and `DEPARTMENT` and provides a SQL query that calculates the total, average, and median salary for each department.
119+
- run the generated SQL query in the SQL editor in VS Code.
120+
121+
We can refine this query further by asking to remove departments that dont have any employees:
122+
![alt text](image-4.png)
123+
124+
125+
#### Tables context provider:
126+
127+
When you connect to a system and start an SQL Job, we automatically create a default schema contex provider with the tables in that schema. This allows you to ask questions about the tables in the schema without having to reference the schema in your queries.
128+
129+
My defult Library is `SAMPLE`, so `@Db2i-SAMPLE` is the context provider for the tables in the SAMPLE library:
130+
![alt text](image-5.png)
131+
132+
Once you select `@Db2i-SAMPLE`, the tables appear in a dopdown list. You can select a table to get a summary of the columns in that table:
133+
![alt text](image-6.png)
134+
135+
Example Prompt:
136+
![alt text](image-7.png)
137+
138+
Note, you do not need to invoke `@Db2i` in order to use the table context items. One advantage to "tagging" the direct table, is that we only look up information for that table, and dont search the entire library list for the table.
139+
140+
You can add additional table context providers by editing your library list in the SQL Job Manager.
141+
1. Open the SQL Job Manager
142+
2. Select New SQL Job, or edit the current Job
143+
3. Add the library as the first entry in the library list
144+
4. Save the Job
145+
146+
In the following image, I added `TOYSTORE3` to the library list, and now I can use the `@Db2i-TOYSTORE3` context provider to get information about the tables in the TOYSTORE3 library:
147+
![alt text](image-8.png)
148+
![alt text](image-9.png)
149+
150+
151+
### Working with other references in your Library List
152+
153+
154+
#### Example 1: Reference a function in QSYS2
155+
![alt text](image-10.png)
156+
157+
**Notes:**
158+
- The model recognizes the function reference `OBJECT_STATISTICS` in the `QSYS2` library and provides a summary of the function.
159+
- Information about the `TOYSTORE3` library is also provided.
160+
- An example of how to use `OBJECT_STATISTICS` is provided.
161+
74162

75-
![alt text](image-18.png)
76163

77-
**Example 2:** Get the department name for each employee
78164

79-
![alt text](image-19.png)
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)