Skip to content

Commit 018e2d8

Browse files
Merge pull request #70 from MohamedSabthar/main
Update AI Agent Quick Start Guide
2 parents ac736bb + 250e9aa commit 018e2d8

File tree

2 files changed

+11
-53
lines changed

2 files changed

+11
-53
lines changed
Loading

en/docs/quick-start-guides/deploy-your-first-ai-agent.md

+11-53
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
In this guide, you will:
66

7-
- Create a simple AI Agent that provides math tutoring assistance.
8-
- Use Ballerina Integrator to develop the AI Agent integration.
9-
- Push the AI Agent to Devant from Ballerina Integrator, which will automatically build and deploy it into the development environment.
10-
- Test the AI Agent by sending prompts.
11-
- Promote it to the production environment and use it as an API.
7+
- Create a simple AI agent that provides math tutoring assistance.
8+
- Use Ballerina Integrator to develop the AI agent integration.
9+
- Push the AI agent to Devant from Ballerina Integrator. This will automatically build and deploy it to the development environment.
10+
- Test the AI agent by sending prompts.
11+
- Once verified, promote it to the production environment and expose it as an API.
1212

1313
<!-- Todo add a YouTube video tutorial for this quick start -->
1414

@@ -64,51 +64,8 @@ This redirects you to the overview page of the AI Agent. Now, let's develop the
6464

6565
<a href="{{base_path}}/assets/img/get-started/bi-setup.gif"><img src="{{base_path}}/assets/img/get-started/bi-setup.gif" alt="Ballerina Integrator Setup" width="80%"></a>
6666

67-
## Step 4: Develop AI Agent in VS Code
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.
69-
2. In the Ballerina Integrator design view, click **Add Artifact**.
70-
3. Select **AI Chat Agent** from the Constructs menu. Choosing the **AI Agent** from the Devant console disables the other options.
71-
4. Provide the name of the Agent as `MathTutor` and click **Create**. This directs you to the AI Chat Agent diagram view.
72-
5. Click the OpenAI icon in the diagram view to configure the LLM model, and add the following configurables:
73-
74-
| Field | Value |
75-
|-------------------------|--------------------|
76-
| **Select Model Family** | `AzureOpenAiModel` |
77-
| **Variable Name** | `_mathTutorModel` |
78-
| **API Key** | `apiKey` |
79-
| **API Version** | `apiVersion` |
80-
| **Deployment ID** | `deploymentId` |
81-
| **Service URL** | `serviceUrl` |
82-
83-
6. Click **Save**.
84-
85-
<a href="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/initialize-agent.gif"><img src="{{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`.
89-
9. Set the **Return Type** as `decimal` and click **Create**.
90-
10. Now, let's create the function return logic. Click the plus icon after the **Start** node to open the node panel.
91-
11. Select **Return** and enter the **Expression** as `a * b`.
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-
<a href="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/add-function.gif"><img src="{{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,
103-
104-
| Variable | Type |
105-
|---------------------|------------|
106-
| `apiKey` | `string` |
107-
| `apiVersion` | `string` |
108-
| `deploymentId` | `string` |
109-
| `serviceUrl` | `string` |
110-
111-
<a href="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/add-tool.gif"><img src="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/add-tool.gif" alt="Add as a Tool" width="80%"></a>
67+
## Step 4: Develop the AI Agent in VS Code
68+
To build your AI Agent using Ballerina Integrator, refer to the [AI Agent Integration](https://wso2.github.io/docs-bi/learn/ai-agent-integration) guide on the Learn page.
11269

11370
## Step 5: Push to Devant
11471
1. Click the **Source Control** icon on the sidebar.
@@ -125,9 +82,10 @@ This redirects you to the overview page of the AI Agent. Now, let's develop the
12582
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.
12683

12784
2. Once the **Build Status** shows `Build completed`, it will be automatically deployed into the development card.
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.
85+
3. Then, click the **Configure to Continue** button, enter the configurable values, and click **`Apply`**.
86+
4. Send the prompt `What is 87,657 * 67,997` 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.
12987

13088
<a href="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/test-agent-in-devant.gif"><img src="{{base_path}}/assets/img/get-started/deploy-your-first-ai-agent/test-agent-in-devant.gif" alt="Ballerina Integrator Icon" width="80%"></a>
13189

132-
4. After successfully testing, you can promote your AI Agent to production by clicking the **Promote** button.
133-
5. Once deployed to production, you can access your AI Agent through the API endpoints and embed it in your applications.
90+
5. After successfully testing, you can promote your AI Agent to production by clicking the **Promote** button.
91+
6. Once deployed to production, you can access your AI Agent through the API endpoints and embed it in your applications.

0 commit comments

Comments
 (0)