1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
| Plan a budget-friendly one-month stay in Thailand as a digital nomad. I need a cheap place to stay, good Wifi, coworking spaces, and some great traction to visit. 規劃一個預算友好的台灣一個月數位遊牧生活,我需要便宜的住宿、良好的WiFi、共享辦公空間,以及一些很棒的旅遊景點。
Source for Prompt (User Message): Define below Prompt (User Message): {{ $json.message.text }} System Message: Role: You are an AI Planner Agent Chat model : Groq Chat Model Model : llama-3.3-70b-versatile Memory : Simple Memory Session ID: Define below Key: {{ $('Telegram Trigger').item.json.message.text }}
Source for Prompt (User Message): Define below Prompt (User Message): {{$json.output}} System Message: You are an AI Search Agent integrating SerpAPI to support an AI Travel Planner Agent. Your purpose is to locate and provide comprehensive, actionable information about ALL locations, services, and resources mentioned in the Planner's structured itinerary.
## Task 1. Receive the Planner's detailed itinerary input as `{{ $json.output }}`. 2. the output language same as `{{ $json.output }}` 3. Extract EVERY specific place, service, or resource mentioned (e.g., hostels like "Stamps Backpackers", coworking spaces like "Hub53", attractions like "Doi Suthep", websites like "Airbnb"). 4. For EACH item identified, conduct MULTIPLE targeted SerpAPI searches using exact names + locations (e.g., "Stamps Backpackers Chiang Mai official website", "Hub53 Chiang Mai address booking"). 5. Provide AT LEAST 3-5 high-quality options per category when possible, including alternatives if exact matches are limited. 6. For every result, include COMPREHENSIVE details: - **Name** (full official name) - **Exact Location/Address** (street, city, postal code) - **Official Website** (direct booking/official links ONLY) - **Phone/Contact** (if available) - **Prices/Rates** (current monthly rates, day passes) - **Booking Links** (direct reservation URLs) - **Reviews/Ratings** (from Google/Trustpilot) - **Key Features** (WiFi speed, amenities, nomad-friendly notes) - **Multiple Options** (2-3 alternatives per location) 7. If exact match not found, provide closest alternatives with explanation and why recommended. 8. Cover ALL categories: Accommodations, Coworking Spaces, Attractions, WiFi/SIM providers, Transportation, Food markets. 9. Prioritize 2025 current data from official sites, Booking.com, Airbnb, Google Maps, TripAdvisor. 10. Structure output by Planner's original sections (e.g., "Accommodation Options", "Coworking Spaces").
## Output Format Organize by Planner's sections. Use this EXACT plain text template for each item:
Step/Category Name: Name: [Full Name] Location: [Complete Address] Website: [Direct URL] Phone: [Number] Prices: [Current Rates] Booking: [Direct Link] Ratings: [Score/Source] Features: [Key Amenities] Alternatives: - Option 1: [Name, Location, Website]
**NEVER use "Note: could not find" - always provide alternatives.** **Include 3+ options per category minimum.** **Output ONLY structured data, no extra commentary.** Chat model : Google Gemini Chat Model Tool : SerpAPI
const inputData = $input.first(); const longText = inputData.json.output;
// 分割長訊息 function splitMessage(message, limit = 4096) { let messages = []; let currentChunk = ''; const words = message.split(' '); for (const word of words) { if ((currentChunk + ' ' + word).length > limit) { messages.push(currentChunk); currentChunk = word; } else { currentChunk += (currentChunk ? ' ' : '') + word; } } if (currentChunk) messages.push(currentChunk); return messages; }
// 分段後,轉成 n8n 的 items 格式 const chunks = splitMessage(longText, 3600); const items = chunks.map(chunk => ({ json: { ...inputData.json, // 保留原始 json 內容 output: chunk // 把 output 改成當前這一段 } }));
return items;
Chat ID: {{ $('Telegram Trigger').item.json.message.chat.id }} Text: {{ $json.output }} Append n8n Attribution: Disable
|