You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/docs/quick-start-guides/deploy-your-first-ai-agent.md
+33-21
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,12 @@ In this guide, you will:
21
21
3. Read and accept the privacy policy and terms of use and click **Create**.
22
22
3. VSCode: [Install VSCode](https://code.visualstudio.com/download) if you don't have it installed already.
23
23
24
-
<!-- Todo finalize the names and structure -->
25
24
## Step 1: Attach a Git repository
26
25
1. Go to [https://console.devant.dev/new](https://console.devant.dev/new) and sign in. This opens the new integration page.
27
26
2. On the new integration page, click **Attach a Git Repository**.
28
27
29
28
!!! tip
30
-
If you're using a public Git repository, you can skip ahead to sub-step 9. Click **Use a Third-Party Public Git Repository** and enter the repository URL.
29
+
If you're using a public Git repository, you can skip ahead to sub-step 8. Click **Use a Third-Party Public Git Repository** and enter the repository URL.
31
30
32
31
3. Click **Authorize with GitHub** to connect Devant to your GitHub account. If you haven't connected your GitHub repository to Devant, authorize the WSO2 cloud app with your GitHub account [WSO2 Cloud App](https://github.com/marketplace/choreo-apps).
33
32
4. Under the **Organization** dropdown click **+ Add**. This redirects you to the **Install WSO2 Cloud App** page.
@@ -57,15 +56,18 @@ This redirects you to the overview page of the AI Agent. Now, let's develop the
57
56
58
57
## Step 3: Set up Ballerina Integrator for the first time
59
58
1. Click the Ballerina Integrator icon on the sidebar.
2. Click **`Set Up Ballerina Integrator`**. The setup wizard installs and configures the [Ballerina](https://ballerina.io/) distribution required for the Ballerina Integrator.
62
63
3. Click **`Restart VS Code`** to complete the setup.
1. Go to the Overview page of the integration you have created and click **Develop in Ballerina Integrator**. This will clone your project and open in Ballerina Integrator.
68
+
1. Go to the Overview page of the integration you have created and click **Develop in Ballerina Integrator**. This will clone your project and open it in Ballerina Integrator.
67
69
2. In the Ballerina Integrator design view, click **Add Artifact**.
68
-
3. Select **AI Chat Agent** from the Constructs menu. Since **AI Agent**has been chosen from the Devant console, other options are disabled.
70
+
3. Select **AI Chat Agent** from the Constructs menu. Choosing the **AI Agent** from the Devant console disables the other options.
69
71
4. Provide the name of the Agent as `MathTutor` and click **Create**. This directs you to the AI Chat Agent diagram view.
70
72
5. Click the OpenAI icon in the diagram view to configure the LLM model, and add the following configurables:
71
73
@@ -78,17 +80,26 @@ This redirects you to the overview page of the AI Agent. Now, let's develop the
78
80
|**Deployment ID**|`deploymentId`|
79
81
|**Service URL**|`serviceUrl`|
80
82
81
-
6. Click on save in order to save the configurations.
82
-
7. From the left side panel, create a new function. Name it as `mult`.
83
-
8. Create two `decimal` parameters, `a` and `b` as the **Function parameters**.
83
+
6. Click **Save**.
84
+
85
+
<ahref="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/initialize-agent.gif"><imgsrc="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/initialize-agent.gif"alt="Initialize AI Agent"width="80%"></a>
86
+
87
+
7. From the left side panel, click **+** on the **Functions** to create a new function. Name it as `mult`.
88
+
8. Click **+ Add Parameter** and add two `decimal` parameters, `a` and `b`.
84
89
9. Set the **Return Type** as `decimal` and click **Create**.
85
-
10. Click the plus icon after the **Start** node to open the node panel.
90
+
10.Now, let's create the function return logic. Click the plus icon after the **Start** node to open the node panel.
86
91
11. Select **Return** and enter the **Expression** as `a * b`.
87
-
12. In the Agent box, click the plus icon to create a tool and click the **+ Create New Tool** on the right panel.
88
-
13. Select the `mult` function you just created under **Current Integrations**.
89
-
14. Provide the **Tool Name** as `getMult` and click **Save Tool**.
90
-
15. Click the agent box and enter `Math Tutor` as the role and enter the instructions as ***"You are a school tutor assistant. Provide answers to students' questions so they can compare their answers. Use the tools when there is query related to math".*** Then click on save.
91
-
16. From the left side panel, click **Configurations**, and add the following configurables,
92
+
12. Click the source icon `(<\>)` in the top right corner to view the source code of the function.
93
+
13. Add the `isolated` keyword before the function definition to make it an isolated function.
94
+
95
+
<ahref="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/add-function.gif"><imgsrc="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/add-function.gif"alt="Initialize AI Agent"width="80%"></a>
96
+
97
+
14. Now, let's add the `mult` function as a tool to the AI Agent. Click `mathTutor` under **Entry Points** on the left navigation. This brings up the AI Agent diagram view.
98
+
15. In the Agent box, click the plus icon to create a tool and click **+ Create New Tool** on the right panel.
99
+
16. Select the `mult` function you just created under **Current Integrations**.
100
+
17. Provide the **Tool Name** as `getMult` and click **Save Tool**.
101
+
18. Click the agent box and enter `Math Tutor` as the role and enter the instructions as `"You are a school tutor assistant. Provide answers to students' questions so they can compare their answers. Use the tools when there is query related to math".` Then click **Save**.
102
+
19. From the left side panel, click **+** on the **Configurations**, and add the following configurables,
92
103
93
104
| Variable | Type |
94
105
|---------------------|------------|
@@ -97,25 +108,26 @@ This redirects you to the overview page of the AI Agent. Now, let's develop the
97
108
|`deploymentId`|`string`|
98
109
|`serviceUrl`|`string`|
99
110
100
-
## Step 5: Push to Devant <!-- Todo Update this if this is supported by the Ballerina Integrator extension itself -->
111
+
<ahref="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/add-tool.gif"><imgsrc="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/add-tool.gif"alt="Add as a Tool"width="80%"></a>
112
+
113
+
## Step 5: Push to Devant
101
114
1. Click the **Source Control** icon on the sidebar.
102
115
2. Click **+** to stage all changes.
103
116
3. Add an appropriate commit message and commit.
104
117
4. Click **Sync Changes** to push the changes to remote.
105
-
5. Go back to the **Design** view using the back arrow on the top left coner.
118
+
5. Go back to the **Design** view using the back arrow in the top left corner.
106
119
6. From the right side panel, click the **View in Devant** to view this integration in Devant.
107
120
108
-
## Step 6: Test and Consume AI Agent
121
+
## Step 6: Test AI Agent
109
122
1. Once you push the changes, the overview page of the Devant AI Agent will automatically refresh and show you the **Latest Commit** and automatically builds and shows the **Build Status**.
110
123
111
124
!!! note
112
125
The build process may take some time. Once complete, the build status changes to **Success**. You can see the Build History by clicking **Build** in the left navigation.
113
126
114
127
2. Once the **Build Status** shows `Build completed`, it will be automatically deployed into the development card.
115
-
3. Send a prompt to test your Math Tutor agent, such as `What is 2343282 * 392011`. Even though typically LLMs are bad at large multiplication, this agent has tool support to give an accurate answer.
128
+
3. Send the prompt `What is 2343282 * 392011` to test your Math Tutor agent. Even though typically LLMs are bad at large multiplication, this agent has tool support to give an accurate answer.
2. Click **`Set Up Ballerina Integrator`**. The setup wizard installs and configures the [Ballerina](https://ballerina.io/) distribution required for the Ballerina Integrator.
63
63
3. Click **`Restart VS Code`** to complete the setup.
1. Go to the Overview page of the integration you have created and click **Develop in Ballerina Integrator**. This will clone your project and open in Ballerina Integrator.
0 commit comments