Skip to content

Commit 222aa42

Browse files
committed
new docs
1 parent cd5b012 commit 222aa42

File tree

16 files changed

+165
-175
lines changed

16 files changed

+165
-175
lines changed

.astro/astro/content.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,20 @@ declare module 'astro:content' {
320320
collection: "docs";
321321
data: InferEntrySchema<"docs">
322322
} & { render(): Render[".mdx"] };
323+
"extensions/db2i/AI/Continue/Continue.mdx": {
324+
id: "extensions/db2i/AI/Continue/Continue.mdx";
325+
slug: "extensions/db2i/ai/continue/continue";
326+
body: string;
327+
collection: "docs";
328+
data: InferEntrySchema<"docs">
329+
} & { render(): Render[".mdx"] };
330+
"extensions/db2i/AI/Copilot/Copilot.mdx": {
331+
id: "extensions/db2i/AI/Copilot/Copilot.mdx";
332+
slug: "extensions/db2i/ai/copilot/copilot";
333+
body: string;
334+
collection: "docs";
335+
data: InferEntrySchema<"docs">
336+
} & { render(): Render[".mdx"] };
323337
"extensions/db2i/AI/code-assistant.mdx": {
324338
id: "extensions/db2i/AI/code-assistant.mdx";
325339
slug: "extensions/db2i/ai/code-assistant";

package-lock.json

Lines changed: 1 addition & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Continue Integration
3+
---
4+
import { Aside, CardGrid, Card, LinkCard, Steps, Badge } from '@astrojs/starlight/components';
5+
import { Image } from 'astro:assets';
6+
7+
This Document provides a more in depth tutorial and demo for using the Continue VSCode extension with Db2 for i.
8+
9+
## Getting Started: Continue
10+
![alt text](image-17.png)
11+
12+
Continue is the leading open source AI code assistant for VS Code. It provides a wide range of AI features:
13+
14+
* Chat Interface
15+
* Code Completion
16+
* Autocomplete
17+
18+
### Install the Continue extension for VS Code
19+
20+
<Steps>
21+
1. Install the Continue extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Continue.continue).
22+
![alt text](image-14.png)
23+
2. Once Installed, there will be a new icon in your VS Code menu (mine is on the top right). Click on the icon to open the chat window.
24+
![alt text](image-15.png)
25+
</Steps>
26+
27+
Once you have the extension installed, you can configure the AI provider you want to use. Continue supports multiple AI providers (including [Watsonx](https://docs.continue.dev/customize/model-providers/more/watsonx)!). You can choose the provider you want to use by clicking on the settings icon in the chat window.
28+
29+
For demonstration purposes, we will use the Ollama Provider for hosting LLMs locally on your machine.
30+
31+
### Setting up Ollama Provider
32+
33+
Here is a step-by-step guide to setting up the Ollama provider with the IBM Granite models in Continue:
34+
35+
#### 1. Install Ollama
36+
37+
Install Ollama on your machine by following the link below:
38+
<LinkCard title="Install Ollama" href="https://ollama.com/download" />
39+
40+
#### 2. Fetch the IBM Granite 3.0 models
41+
42+
The IBM Granite 3.0 models are available in the Ollama model registry. More information about the IBM Granite models can be found [here](https://ollama.com/blog/ibm-granite).
43+
44+
Using the Ollama CLI, fetch the IBM Granite 3.0 8b model by running the following command:
45+
```bash
46+
ollama pull granite3-dense:8b
47+
```
48+
49+
#### 3. Configure the Ollama provider in Continue
50+
51+
Open the VSCode Command Palette (Press ctrl+shift+p) and search for `Continue: open config.json`. This will open the Continue central config file `$HOME/.continue/config.json` in your editor. To enable the Granite models in Ollama, add the following configuration to the `models` section:
52+
53+
```json title="~/.continue/config.json"
54+
"models": [
55+
{
56+
"title": "Granite Code 8b",
57+
"provider": "ollama",
58+
"model": "granite3-dense:8b"
59+
}
60+
],
61+
```
62+
63+
save this file and select the Granite model in the chat window.
64+
65+
![alt text](image-16.png)
66+
67+
### Examples
68+
69+
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.
70+
71+
More on context providers can be found [here](https://docs.continue.dev/customize/context-providers/).
72+
73+
**Example 1:** Summarize the columns in the `EMPLOYEE` table
74+
75+
![alt text](image-18.png)
76+
77+
**Example 2:** Get the department name for each employee
78+
79+
![alt text](image-19.png)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1.24 MB
Loading
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
title: Copilot Integration
3+
---
4+
import { Aside, CardGrid, Card, LinkCard, Steps, Badge } from '@astrojs/starlight/components';
5+
import { Image } from 'astro:assets';
6+
7+
## Getting Started: Github Copilot
8+
9+
![alt text](../Copilot/image.png)
10+
11+
You can use GitHub Copilot, with the `@db2i` chat participant, to ask questions either about Db2 for IBM i or about specific tables in the current schema of the selected job. You can ask things like:
12+
13+
```text
14+
@db2i What columns make up an employee?
15+
```
16+
17+
```text
18+
@db2i Can you get the department name for each employee?
19+
```
20+
21+
```text
22+
@db2i Write a select statement to count how many employees are in each department
23+
```
24+
25+
### Install the GitHub Copilot extension
26+
27+
<Steps>
28+
29+
1. Install GitHub Copilot from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot).
30+
31+
2. Install the Db2 for IBM i extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=IBM.db2-for-i).
32+
3. Connect to your IBM i system using the Code for IBM i extension.
33+
4. Once connected, the `@db2i` chat participant is available in the chat window. You can ask questions about your database, and get help with writing SQL queries.
34+
35+
</Steps>
36+
37+
<Aside type="note">
38+
Chat participants are domain experts that can answer questions about a specific topic. The `@db2i` chat participant is a domain expert in Db2 for IBM i. It can answer questions about the structure of your database, and help you write SQL queries.
39+
</Aside>
40+
41+
### Examples
42+
43+
Once GitHub Copilot is installed, you can ask questions about your database using the `@db2i` chat participant. Here are some examples:
44+
45+
46+
**Example 1** Summarize the columns in the `EMPLOYEE` table
47+
48+
This is a simple example to show how you can ask questions about the structure of your database. You can ask the chat participant to summarize the columns in a table.
49+
50+
![alt text](image-2.png)
51+
52+
**Example 2:** Get the department name for each employee
53+
54+
This example shows how you can ask the chat participant to write a query that joins two tables to get the department name for each employee. The chat participant will generate the SQL query for you that you can run directly in your SQL editor in VS Code.
55+
56+
![alt text](image-4.png)
57+
58+
Run the Generated SQL to get the result:
59+
![alt text](image-5.png)
60+
61+
<Aside type="tip">
62+
You can set the current schema by running the `SET SCHEMA` command in the SQL script editor.
63+
</Aside>
64+
65+
**Example 3:** Calculate the Average salary for each department
66+
67+
A slightly more complex example that shows how you can ask the chat participant to write a query that calculates the average salary for each department.
68+
![alt text](image-11.png)

0 commit comments

Comments
 (0)