Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions Lab-02-building-travel-planner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,18 @@ cd o2-business-apis/search-api
bal run
```

### 2. Start the AI Agent (BFF)
### 2. Start the Weather MCP Server

Before starting the AI Agent, you need to set up the Weather MCP server.

1. Clone the repository:
```bash
git clone https://github.com/xlight05/mcp-openweathermap.git
```

2. Follow the setup guide in the repository's README to start the MCP server.
Comment on lines +71 to +80
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Weather MCP server setup instructions are quite minimal. Consider adding more specific guidance such as: whether an OpenWeatherMap API key is needed, what configuration files need to be created, and what the expected output looks like when the server is running successfully. This would help developers complete the setup without having to navigate to an external repository.

Copilot uses AI. Check for mistakes.

### 3. Start the AI Agent (BFF)

The main agent acts as the Backend-for-Frontend and coordinates with all business APIs:

Expand All @@ -81,7 +92,7 @@ bal run

The agent will be available at: `http://localhost:9090` (default Ballerina AI listener port)

### 3. Start the Frontend
### 4. Start the Frontend

Prerequisite:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ sticky = true
[[tool.openapi]]
id = "adminApi"
targetModule = "adminApi"
filePath = "/Users/wso2/2025-CMB-AI-tutorial/resources/admin_api_spec.yaml"
filePath = "../../resources/admin_api_spec.yaml"

[[tool.openapi]]
id = "hotelSearchApi"
targetModule = "hotelSearchApi"
filePath = "/Users/wso2/2025-CMB-AI-tutorial/resources/search_api_spec.yaml"
filePath = "../../resources/search_api_spec.yaml"
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ sticky = true
[[tool.openapi]]
id = "hotelSearchApi"
targetModule = "hotelSearchApi"
filePath = "/Users/wso2/asia-con/resources/search_api_spec.yaml"
filePath = "../../resources/search_api_spec.yaml"

[[tool.openapi]]
id = "bookingApi"
targetModule = "bookingApi"
filePath = "/Users/wso2/asia-con/resources/booking_api_spec.yaml"
filePath = "../../resources/booking_api_spec.yaml"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ballerina/ai;

isolated function queryHotelPolicy(string question, string hotelId) returns string|error {
ai:QueryMatch[] aiQuerymatch = check aiVectorknowledgebase.retrieve(question, getHotelFilters(hotelId));
ai:QueryMatch[] aiQuerymatch = check aiVectorknowledgebase.retrieve(question, -1, getHotelFilters(hotelId));
ai:ChatUserMessage aiChatusermessage = ai:augmentUserQuery(aiQuerymatch, question);
ai:ChatAssistantMessage aiChatassistantmessage = check _travelPlannerModel->chat(aiChatusermessage, []);
return aiChatassistantmessage.content.ensureType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ isolated function getHotelFilters(string hotelId) returns ai:MetadataFilters {
};

isolated function queryHotelPolicies(string question, string hotelId) returns string|error {
ai:QueryMatch[] aiQuerymatch = check aiVectorknowledgebase.retrieve(question, getHotelFilters(hotelId));
ai:QueryMatch[] aiQuerymatch = check aiVectorknowledgebase.retrieve(question, -1, getHotelFilters(hotelId));
ai:ChatUserMessage aiChatusermessage = ai:augmentUserQuery(aiQuerymatch, question);
ai:ChatAssistantMessage aiChatassistantmessage = check _policyAgentModel->chat(aiChatusermessage, []);
return aiChatassistantmessage.content.ensureType();
Expand Down
1 change: 1 addition & 0 deletions Lab-02-building-travel-planner/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Dependencies
node_modules/

/.pnp
.pnp.js
npm-debug.log*
Expand Down
29 changes: 26 additions & 3 deletions Lab-02-building-travel-planner/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.