Tool: Look up user information
| 39 | |
| 40 | // Tool: Look up user information |
| 41 | ai::JsonValue lookup_user(const ai::JsonValue& args, |
| 42 | const ai::ToolExecutionContext& context) { |
| 43 | std::string user_id = args["user_id"].get<std::string>(); |
| 44 | |
| 45 | std::cout << "🔍 Looking up user: " << user_id << std::endl; |
| 46 | |
| 47 | auto it = user_database.find(user_id); |
| 48 | if (it != user_database.end()) { |
| 49 | return it->second; |
| 50 | } else { |
| 51 | return ai::JsonValue{{"error", "User not found"}}; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // Tool: Get weather for a location |
| 56 | ai::JsonValue get_weather(const ai::JsonValue& args, |