সম্পূর্ণ উদাহরণ সোর্স কোড দেখুন
AI-পরিচালিত সারসংক্ষেপ দেখতে জায়গা সার্চ করুন। কিছু সাজেস্ট করা সার্চ:
- আশেপাশের এলাকার সারসংক্ষেপের জন্য "হোটেল"।
- EVCS-এর সুযোগ-সুবিধার সারসংক্ষেপের জন্য "EV চার্জিং স্টেশন"।
- জায়গা ও রিভিউয়ের সারসংক্ষেপের জন্য যেকোনও রেস্তোরাঁ বা ব্যবসা।
TypeScript
// Define DOM elements. const mapElement = document.querySelector('gmp-map')!; const placeAutocomplete = document.querySelector('gmp-place-autocomplete')!; const summaryPanel = document.getElementById('summary-panel')!; const placeName = document.getElementById('place-name')!; const placeAddress = document.getElementById('place-address')!; const tabContainer = document.getElementById('tab-container')!; const summaryContent = document.getElementById('summary-content')!; const aiDisclosure = document.getElementById('ai-disclosure')!; const flagContentLink = document.getElementById( 'flag-content-link' ) as HTMLAnchorElement; let innerMap: google.maps.Map; let marker: google.maps.marker.AdvancedMarkerElement; async function init(): Promise<void> { // Request needed libraries. const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), google.maps.importLibrary('places'), ]); innerMap = mapElement.innerMap; innerMap.setOptions({ mapTypeControl: false, streetViewControl: false, fullscreenControl: false, }); // Bind autocomplete bounds to map bounds. innerMap.addListener('bounds_changed', () => { placeAutocomplete.locationRestriction = innerMap.getBounds()!; }); // Create the marker. marker = new AdvancedMarkerElement({ map: innerMap, }); // Handle selection of an autocomplete result. placeAutocomplete.addEventListener( 'gmp-select', async ({ placePrediction }) => { const place = placePrediction.toPlace(); // Fetch all summary fields. await place.fetchFields({ fields: [ 'displayName', 'formattedAddress', 'location', 'generativeSummary', 'neighborhoodSummary', 'reviewSummary', 'evChargeAmenitySummary', ], }); // Update the map viewport and position the marker. if (place.viewport) { innerMap.fitBounds(place.viewport); } else { innerMap.setCenter(place.location!); innerMap.setZoom(17); } marker.position = place.location; // Update the panel UI. updateSummaryPanel(place); } ); } function updateSummaryPanel(place: google.maps.places.Place) { // Reset UI summaryPanel.classList.remove('hidden'); tabContainer.innerHTML = ''; // innerHTML is OK here since we're clearing known child elements. summaryContent.textContent = ''; aiDisclosure.textContent = ''; placeName.textContent = place.displayName || ''; placeAddress.textContent = place.formattedAddress || ''; let firstTabActivated = false; /** * Safe Helper: Accepts either a text string or a DOM Node (like a div or DocumentFragment). */ const createTab = ( label: string, content: string | Node, disclosure: string | null, flagUrl: string | null ) => { const btn = document.createElement('button'); btn.className = 'tab-button'; btn.textContent = label; btn.onclick = () => { // Do nothing if the tab is already active. if (btn.classList.contains('active')) { return; } // Manage the active class state. document.querySelectorAll('.tab-button').forEach((b) => { b.classList.remove('active'); }); btn.classList.add('active'); if (typeof content === 'string') { summaryContent.textContent = content; } else { summaryContent.replaceChildren(content.cloneNode(true)); } // Set the disclosure text. aiDisclosure.textContent = disclosure || 'AI-generated content.'; // Add the content flag URI. if (flagUrl) { flagContentLink.href = flagUrl; flagContentLink.textContent = 'Report an issue'; } }; tabContainer.appendChild(btn); // Auto-select the first available summary. if (!firstTabActivated) { btn.click(); firstTabActivated = true; } }; // --- 1. Generative Summary (Place) --- if (place.generativeSummary?.overview) { createTab( 'Overview', place.generativeSummary.overview, place.generativeSummary.disclosureText, place.generativeSummary.flagContentURI ); } // --- 2. Review Summary --- if (place.reviewSummary?.text) { createTab( 'Reviews', place.reviewSummary.text, place.reviewSummary.disclosureText, place.reviewSummary.flagContentURI ); } // --- 3. Neighborhood Summary --- if (place.neighborhoodSummary?.overview?.content) { createTab( 'Neighborhood', place.neighborhoodSummary.overview.content, place.neighborhoodSummary.disclosureText, place.neighborhoodSummary.flagContentURI ); } // --- 4. EV Amenity Summary (uses content blocks)) --- if (place.evChargeAmenitySummary) { const evSummary = place.evChargeAmenitySummary; const evContainer = document.createDocumentFragment(); // Helper to build a safe DOM section for EV categories. const createSection = (title: string, text: string) => { const wrapper = document.createElement('div'); wrapper.style.marginBottom = '15px'; // Or use a CSS class const titleEl = document.createElement('strong'); titleEl.textContent = title; const textEl = document.createElement('div'); textEl.textContent = text; wrapper.appendChild(titleEl); wrapper.appendChild(textEl); return wrapper; }; // Check and append each potential section if (evSummary.overview?.content) { evContainer.appendChild( createSection('Overview', evSummary.overview.content) ); } if (evSummary.coffee?.content) { evContainer.appendChild( createSection('Coffee', evSummary.coffee.content) ); } if (evSummary.restaurant?.content) { evContainer.appendChild( createSection('Food', evSummary.restaurant.content) ); } if (evSummary.store?.content) { evContainer.appendChild( createSection('Shopping', evSummary.store.content) ); } // Only add the tab if the container has children if (evContainer.hasChildNodes()) { createTab( 'EV Amenities', evContainer, // Passing a Node instead of string evSummary.disclosureText, evSummary.flagContentURI ); } } // Safely handle the empty state. if (!firstTabActivated) { const msg = document.createElement('em'); msg.textContent = 'No AI summaries are available for this specific location.'; summaryContent.replaceChildren(msg); aiDisclosure.textContent = ''; } } void init();
জাভাস্ক্রিপ্ট
// Define DOM elements. const mapElement = document.querySelector('gmp-map'); const placeAutocomplete = document.querySelector('gmp-place-autocomplete'); const summaryPanel = document.getElementById('summary-panel'); const placeName = document.getElementById('place-name'); const placeAddress = document.getElementById('place-address'); const tabContainer = document.getElementById('tab-container'); const summaryContent = document.getElementById('summary-content'); const aiDisclosure = document.getElementById('ai-disclosure'); const flagContentLink = document.getElementById('flag-content-link'); let innerMap; let marker; async function init() { // Request needed libraries. const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), google.maps.importLibrary('places'), ]); innerMap = mapElement.innerMap; innerMap.setOptions({ mapTypeControl: false, streetViewControl: false, fullscreenControl: false, }); // Bind autocomplete bounds to map bounds. innerMap.addListener('bounds_changed', () => { placeAutocomplete.locationRestriction = innerMap.getBounds(); }); // Create the marker. marker = new AdvancedMarkerElement({ map: innerMap, }); // Handle selection of an autocomplete result. placeAutocomplete.addEventListener( 'gmp-select', async ({ placePrediction }) => { const place = placePrediction.toPlace(); // Fetch all summary fields. await place.fetchFields({ fields: [ 'displayName', 'formattedAddress', 'location', 'generativeSummary', 'neighborhoodSummary', 'reviewSummary', 'evChargeAmenitySummary', ], }); // Update the map viewport and position the marker. if (place.viewport) { innerMap.fitBounds(place.viewport); } else { innerMap.setCenter(place.location); innerMap.setZoom(17); } marker.position = place.location; // Update the panel UI. updateSummaryPanel(place); } ); } function updateSummaryPanel(place) { // Reset UI summaryPanel.classList.remove('hidden'); tabContainer.innerHTML = ''; // innerHTML is OK here since we're clearing known child elements. summaryContent.textContent = ''; aiDisclosure.textContent = ''; placeName.textContent = place.displayName || ''; placeAddress.textContent = place.formattedAddress || ''; let firstTabActivated = false; /** * Safe Helper: Accepts either a text string or a DOM Node (like a div or DocumentFragment). */ const createTab = (label, content, disclosure, flagUrl) => { const btn = document.createElement('button'); btn.className = 'tab-button'; btn.textContent = label; btn.onclick = () => { // Do nothing if the tab is already active. if (btn.classList.contains('active')) { return; } // Manage the active class state. document.querySelectorAll('.tab-button').forEach((b) => { b.classList.remove('active'); }); btn.classList.add('active'); if (typeof content === 'string') { summaryContent.textContent = content; } else { summaryContent.replaceChildren(content.cloneNode(true)); } // Set the disclosure text. aiDisclosure.textContent = disclosure || 'AI-generated content.'; // Add the content flag URI. if (flagUrl) { flagContentLink.href = flagUrl; flagContentLink.textContent = 'Report an issue'; } }; tabContainer.appendChild(btn); // Auto-select the first available summary. if (!firstTabActivated) { btn.click(); firstTabActivated = true; } }; // --- 1. Generative Summary (Place) --- if (place.generativeSummary?.overview) { createTab( 'Overview', place.generativeSummary.overview, place.generativeSummary.disclosureText, place.generativeSummary.flagContentURI ); } // --- 2. Review Summary --- if (place.reviewSummary?.text) { createTab( 'Reviews', place.reviewSummary.text, place.reviewSummary.disclosureText, place.reviewSummary.flagContentURI ); } // --- 3. Neighborhood Summary --- if (place.neighborhoodSummary?.overview?.content) { createTab( 'Neighborhood', place.neighborhoodSummary.overview.content, place.neighborhoodSummary.disclosureText, place.neighborhoodSummary.flagContentURI ); } // --- 4. EV Amenity Summary (uses content blocks)) --- if (place.evChargeAmenitySummary) { const evSummary = place.evChargeAmenitySummary; const evContainer = document.createDocumentFragment(); // Helper to build a safe DOM section for EV categories. const createSection = (title, text) => { const wrapper = document.createElement('div'); wrapper.style.marginBottom = '15px'; // Or use a CSS class const titleEl = document.createElement('strong'); titleEl.textContent = title; const textEl = document.createElement('div'); textEl.textContent = text; wrapper.appendChild(titleEl); wrapper.appendChild(textEl); return wrapper; }; // Check and append each potential section if (evSummary.overview?.content) { evContainer.appendChild( createSection('Overview', evSummary.overview.content) ); } if (evSummary.coffee?.content) { evContainer.appendChild( createSection('Coffee', evSummary.coffee.content) ); } if (evSummary.restaurant?.content) { evContainer.appendChild( createSection('Food', evSummary.restaurant.content) ); } if (evSummary.store?.content) { evContainer.appendChild( createSection('Shopping', evSummary.store.content) ); } // Only add the tab if the container has children if (evContainer.hasChildNodes()) { createTab( 'EV Amenities', evContainer, // Passing a Node instead of string evSummary.disclosureText, evSummary.flagContentURI ); } } // Safely handle the empty state. if (!firstTabActivated) { const msg = document.createElement('em'); msg.textContent = 'No AI summaries are available for this specific location.'; summaryContent.replaceChildren(msg); aiDisclosure.textContent = ''; } } void init();
CSS
/* Reuse existing map height */ gmp-map { height: 100%; } html, body { height: 100%; margin: 0; padding: 0; } /* Existing Autocomplete Card Style */ .place-autocomplete-card { background-color: #fff; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px; margin: 10px; padding: 2px; font-family: Roboto, sans-serif; font-size: 1rem; } gmp-place-autocomplete { width: 330px; } /* New: Summary Panel Styles */ .summary-card { background-color: #fff; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px; margin: 10px; padding: 0; /* Padding handled by children */ font-family: Roboto, sans-serif; width: 350px; max-height: 80vh; /* Prevent overflow on small screens */ overflow-y: auto; display: flex; flex-direction: column; } .hidden { display: none; } #place-header { padding: 15px; background-color: #f8f9fa; border-bottom: 1px solid #ddd; } #place-header h2 { margin: 0 0 5px 0; font-size: 1.2rem; } #place-address { margin: 0; color: #555; font-size: 0.9rem; } /* Tab Navigation */ .tab-container { display: flex; border-bottom: 1px solid #ddd; background-color: #fff; } .tab-button { flex: 1; background: none; border: none; padding: 10px; cursor: pointer; font-weight: 500; color: #555; border-bottom: 3px solid transparent; } .tab-button:hover { background-color: #f1f1f1; } .tab-button.active { font-weight: bold; border-bottom: 3px solid #000000; } .tab-button.active:hover { background-color: #ffffff; cursor: default; } /* Content Area */ .content-area { padding: 15px; line-height: 1.5; font-size: 0.95rem; color: #333; } .disclosure-footer { font-size: 0.75rem; color: #666; padding: 10px 15px; border-top: 1px solid #eee; font-style: italic; } .flag-content-link { font-size: 0.75rem; color: #666; padding: 10px 15px; border-top: 1px solid #eee; }
HTML
<html>
<head>
<title>AI Place Summaries</title>
<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="module" src="./index.js"></script>
<script>
// prettier-ignore
(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
key: "GOOGLE_MAPS_API_KEY"
});
</script>
</head>
<body>
<gmp-map center="37.80, -122.425" zoom="14" map-id="DEMO_MAP_ID">
<!-- Search Input Card -->
<div
class="place-autocomplete-card"
slot="control-inline-start-block-start">
<gmp-place-autocomplete
placeholder="Find places with AI summaries"></gmp-place-autocomplete>
</div>
<!-- Summary text panel (initially hidden) -->
<div
id="summary-panel"
class="summary-card hidden"
slot="control-inline-end-block-start">
<div id="place-header">
<h2 id="place-name"></h2>
<p id="place-address"></p>
</div>
<!-- Tabs for toggling summary types -->
<div class="tab-container" id="tab-container"></div>
<!-- Content display area -->
<div id="summary-content" class="content-area"></div>
<!-- Legal/AI Disclosure -->
<div id="ai-disclosure" class="disclosure-footer"></div>
<!-- Flag content link -->
<a id="flag-content-link" class="flag-content-link"></a>
</div>
</gmp-map>
</body>
</html>AI-এর মাধ্যমে পরিচালিত সারসংক্ষেপ হল কোনও জায়গা বা এলাকার ওভারভিউ যা নির্দিষ্ট জায়গা, কোনও জায়গার আশেপাশের এলাকা এবং কোনও জায়গার সাথে সম্পর্কিত রিভিউ সম্পর্কে সহায়ক ইনসাইট প্রদান করে। AI-পরিচালিত সারসংক্ষেপ তিন ধরনের হয়:
-
জায়গার সারসংক্ষেপ: কোনও নির্দিষ্ট জায়গা আইডির জন্য ১০০-অক্ষরের সংক্ষিপ্ত ওভারভিউ, যা কোনও জায়গার হাই-লেভেল স্ন্যাপশটে বিভিন্ন ধরনের ডেটা একত্রিত করে।
-
রিভিউয়ের সারসংক্ষেপ: শুধুমাত্র ব্যবহারকারীর রিভিউয়ের ভিত্তিতে কোনও জায়গার জেনারেট করা সারসংক্ষেপ।
-
এলাকার সারসংক্ষেপ: কোনও জায়গার আশেপাশের এলাকার জন্য জেনারেট করা সারসংক্ষেপ, যা আশেপাশের আকর্ষণীয় স্থান সহ অতিরিক্ত প্রসঙ্গ প্রদান করে। এলাকার সারসংক্ষেপ দুই ধরনের হতে পারে:
-
আশেপাশের জায়গার সারাংশ:
premise,street_addressধরনের এবং হাউজিং ও লজিং বিভাগের সব ধরনের জায়গার জন্য আশেপাশের আকর্ষণীয় স্থানগুলির একটি হাই-লেভেল ওভারভিউ। -
ইলেকট্রিক ভেইকেল চার্জিং স্টেশনের সুযোগ-সুবিধার সারাংশ:
electric_vehicle_charging_stationধরনের জায়গার জন্য কাছাকাছি আকর্ষণীয় স্থানের হাই-লেভেল ওভারভিউ।
-
AI-পাওয়ার্ড সারসংক্ষেপ ফিরিয়ে আনুন
AI-পরিচালিত সারসংক্ষেপ ফিরিয়ে আনতে ও দেখাতে, এই ধাপগুলি অনুসরণ করুন:
-
const { Place } = await google.maps.importLibrary("places");
Placeইনস্ট্যান্স পান। নিম্নলিখিত স্নিপেট থেকে দেখা যায় যে, কোনও জায়গার আইডি থেকে কীভাবেPlaceইনস্ট্যান্স তৈরি করতে হয়:const place = new Place("ChIJaYaXFTqq3oARNy537Kb_W_c");
place.fetchFields()-এ আপনার কলে, আপনি যে ধরনের সারসংক্ষেপ ব্যবহার করতে চান তার জন্য ফিল্ড নির্দিষ্ট করুন। নিম্নলিখিত স্নিপেটে সব সারসংক্ষেপ ফিল্ডের অনুরোধ করা হয়েছে:await place.fetchFields({ fields: [ 'generativeSummary', 'neighborhoodSummary', 'reviewSummary', 'evChargeAmenitySummary' // Include other fields as needed. ] });
যথাক্রমে
generativeSummary,neighborhoodSummary,reviewSummaryএবংevChargeAmenitySummaryপ্রপার্টি অ্যাক্সেস করে সারাংশ ডেটা ফিরিয়ে আনুন। নিম্নলিখিত স্নিপেটgenerativeSummaryথেকে ওভারভিউ ফিরিয়ে আনার বিষয়টি দেখায়।const summaryText = place.generativeSummary.overview;
যেহেতু সব জায়গায় AI-পরিচালিত সারসংক্ষেপ নেই, তাই ব্যবহারকারীদের দেখানোর আগে প্রয়োজনীয় ডেটা আছে কিনা তা
নিশ্চিত করুন। নিম্নলিখিত স্নিপেট generativeSummary-এর জন্য চেক করতে
if স্টেটমেন্ট ব্যবহার করে:
if (place.generativeSummary) { overviewText = place.generativeSummary.overview; } else { overviewText = 'No summary is available.'; }
বিকল্প হিসেবে, সারসংক্ষেপের উপস্থিতি সংক্ষেপে চেক করতে নালিশ অপারেটর ব্যবহার করুন:
const overviewText = place.generativeSummary.overview ?? 'No summary is available.';
প্রয়োজনীয় অ্যাট্রিবিউশন দেখান
আপনার অ্যাপে দেখানো AI-পরিচালিত সব সারসংক্ষেপের সাথে Google-এর নীতি ও স্ট্যান্ডার্ড অনুযায়ী উপযুক্ত অ্যাট্রিবিউশন থাকতে হবে। আরও তথ্যের জন্য, Maps JavaScript API-এর জন্য নীতি এবং অ্যাট্রিবিউশন দেখুন।
জায়গার সারসংক্ষেপ
জায়গার সারসংক্ষেপ হল ১০০-অক্ষরের সংক্ষিপ্ত ওভারভিউ যা নির্দিষ্ট কোনও জায়গা আইডির জন্য প্রযোজ্য, যাতে কোনও জায়গার হাই-লেভেল স্ন্যাপশট প্রদান করা যায়। কোনও জায়গার সারসংক্ষেপে জনপ্রিয় খাবার, পরিষেবা বা কেনার জন্য উপলভ্য জিনিসপত্র হাইলাইট করা হতে পারে:
-
"ফোরাম শপস রেস্তোরাঁ যেখানে ক্যাজুয়াল স্পেসে ঐতিহ্যবাহী ইতালীয় খাবারের বড় অংশ পরিবেশন করা হয়।"
-
"স্টাইলিশ সেলুন যেখানে চুল কাটা ও রঙ করা ছাড়াও ব্লোআউট করা হয়।"
-
"অনেক বিক্রেতা সহ বড় স্টোর যেখানে বিভিন্ন ধরনের ভিন্টেজ ডেকোর, আসবাবপত্র এবং পোশাক পাওয়া যায়।"
সংস্কৃতি, বিনোদন ও অবসরযাপন, খাবার ও পানীয়, কেনাকাটা, পরিষেবা এবং খেলাধূলা বিভাগের জন্য কাজ করে এমন ধরন-এ দেখানো জায়গার ধরনের জন্য জায়গার সারসংক্ষেপ উপলভ্য।
নিম্নলিখিত ভাষা ও অঞ্চলে দর্শনীয় স্থানের জন্য জায়গার সারসংক্ষেপ দেখানো হয়:
| ভাষা | অঞ্চল |
|---|---|
| ইংরেজি |
ভারত মার্কিন যুক্তরাষ্ট্র |
কোনও জায়গার সারসংক্ষেপের জন্য অনুরোধ করা
জেনারেটিভ জায়গার সারসংক্ষেপের অনুরোধ করতে, fetchFields() কল করার সময় generativeSummary
ফিল্ড অন্তর্ভুক্ত করুন:
await place.fetchFields({ fields: [ 'generativeSummary', // Include other fields as needed. ], });
জায়গার সারসংক্ষেপ পেতে generativeSummary
প্রপার্টি ব্যবহার করুন। নিম্নলিখিত স্নিপেট generativeSummary থেকে ওভারভিউ এবং
ডিসক্লোজার টেক্সট ফিরিয়ে আনে:
if (place.generativeSummary) { console.log("Place Overview:", place.generativeSummary.overview); console.log("Disclosure:", place.generativeSummary.disclosureText); }
রিভিউয়ের সারসংক্ষেপ
পর্যালোচনার সারসংক্ষেপ হল শুধুমাত্র ব্যবহারকারীর পর্যালোচনার উপর ভিত্তি করে তৈরি করা সারসংক্ষেপ। ব্যবহারকারীর রিভিউয়ের মূল এলিমেন্ট, যেমন জায়গার অ্যাট্রিবিউট ও রিভিউয়ারের মনোভাব সিন্থেসাইজ করে, পর্যালোচনার সারসংক্ষেপ উচ্চ-স্তরের ইনসাইট প্রদান করে এবং ব্যবহারকারীদের ভেবেচিন্তে সিদ্ধান্ত নিতে সাহায্য করে।
যেমন, সান ফ্রান্সিসকোর ফেরি বিল্ডিংয়ের পর্যালোচনার সারসংক্ষেপে খাবার ও কেনাকাটা থেকে শুরু করে দৃশ্য ও পরিবেশ পর্যন্ত তথ্য অন্তর্ভুক্ত থাকে:
"দর্শকরা বলেন যে এই ঐতিহাসিক ল্যান্ডমার্কে বিভিন্ন ধরনের দোকান, রেস্তোরাঁ এবং কৃষকদের বাজার রয়েছে, অনেকেই উপসাগর এবং শহরের দৃশ্যের প্রশংসা করেন। এছাড়াও, তারা প্রাণবন্ত পরিবেশ, অন্যান্য গন্তব্যে যাওয়ার জন্য সুবিধাজনক ফেরি অ্যাক্সেস এবং স্থানীয় ব্যবসা উপভোগ করার সুযোগ হাইলাইট করে।"
নিম্নলিখিত ভাষা ও অঞ্চলে আকর্ষণীয় স্থানের জন্য রিভিউয়ের সারসংক্ষেপ উপলভ্য:
| ভাষা | অঞ্চল |
|---|---|
| ইংরেজি | আর্জেন্টিনা, বলিভিয়া, ব্রাজিল, চিলি, কলম্বিয়া, কোস্টা রিকা, ডোমিনিকান রিপাবলিক, ইকুয়েডর, গুয়াতেমালা, ভারত, জাপান, মেক্সিকো, প্যারাগুয়ে, পেরু, যুক্তরাজ্য, মার্কিন যুক্তরাষ্ট্র, উরুগুয়ে, ভেনেজুয়েলা |
| জাপানি | জাপান |
| পর্তুগিজ | ব্রাজিল |
| স্প্যানিশ | আর্জেন্টিনা, বলিভিয়া, চিলি, কলম্বিয়া, কোস্টা রিকা, ডোমিনিকান রিপাবলিক, ইকুয়েডর, গুয়াতেমালা, মেক্সিকো, প্যারাগুয়ে, পেরু, মার্কিন যুক্তরাষ্ট্র, উরুগুয়ে, ভেনেজুয়েলা |
পর্যালোচনার সারসংক্ষেপের অনুরোধ করুন
পর্যালোচনার সারসংক্ষেপের অনুরোধ করতে, fetchFields() কল করার সময়
reviewSummary ফিল্ড অন্তর্ভুক্ত করুন:
await place.fetchFields({ fields: [ 'reviewSummary', // Include other fields as needed. ], });
পর্যালোচনার সারসংক্ষেপ পেতে
reviewSummary
প্রপার্টি ব্যবহার করুন। রিভিউয়ের সারাংশ পেতে, reviewSummary.text
প্রপার্টি অ্যাক্সেস করুন। নিম্নলিখিত স্নিপেট reviewSummary থেকে টেক্সট ফিরিয়ে আনে।
if (place.reviewSummary) { console.log("Place Review Summary:", place.reviewSummary.text); }
এলাকার সারসংক্ষেপ
কোনও জায়গার আশেপাশের এলাকার জন্য এলাকার সারসংক্ষেপ তৈরি করা হয়। এলাকার সারসংক্ষেপ কোনও লোকেশনের জন্য অতিরিক্ত প্রসঙ্গ প্রদান করে, যার মধ্যে কাছাকাছি আগ্রহের পয়েন্টগুলি অন্তর্ভুক্ত থাকে, যাতে ব্যবহারকারীরা কোথায় যাবেন এবং সেখানে পৌঁছে কী করবেন সেই সম্পর্কে আরও তথ্যপূর্ণ সিদ্ধান্ত নিতে পারেন। যেমন, নতুন কোনও শহরে গেলে, আপনি হোটেলের আশেপাশের এলাকা সম্পর্কে আরও জানতে, সেটির আশেপাশের এলাকার জেনারেট করা সারসংক্ষেপ দেখতে পারেন:
-
"সান ফ্রান্সিসকোর এই প্রাণবন্ত এলাকাটি নর্থ বিচ এবং চায়নাটাউনকে একত্রিত করে, যা ফিনান্সিয়াল ডিস্ট্রিক্টের উত্তর-পশ্চিমে অবস্থিত এবং এখানে সাহিত্যিক ল্যান্ডমার্ক, অনন্য সাংস্কৃতিক আকর্ষণ এবং বিভিন্ন ধরনের ডাইনিংয়ের সুবিধা রয়েছে। উল্লেখযোগ্য স্পটের মধ্যে রয়েছে আইকনিক সিটি লাইটস বুকস্টোর, আকর্ষণীয় কেবল কার মিউজিয়াম এবং চায়নাটাউনের ব্যস্ত রাস্তা।"
আপনি যদি ইলেকট্রিক ভেইকেল চার্জ করার কথা ভাবেন, তাহলে আশেপাশের এলাকা সম্পর্কে আরও জানতে ইলেকট্রিক ভেইকেল চার্জিং স্টেশনের জন্য তৈরি করা সারসংক্ষেপ দেখতে পারেন:
-
"এই এলাকায় ৯-মিনিটের হাঁটাপথের মধ্যে ডাইনিংয়ের অনেক বিকল্প রয়েছে, যার মধ্যে Starbucks, Sushi Jin এবং Safeway অন্তর্ভুক্ত।"
এলাকার বিবরণের সাথে, উত্তরে বিবরণে উল্লেখ করা জায়গাগুলির জন্য Place
ইনস্ট্যান্সের একটি তালিকাও রয়েছে; প্রতিটি জায়গার জন্য আরও বিশদ বিবরণের অনুরোধ করতে এই Place ইনস্ট্যান্সগুলিতে fetchFields() কল করুন।
AI-পরিচালিত এলাকা সংক্রান্ত সারসংক্ষেপ দুই ধরনের হয়:
-
আশেপাশের জায়গার সারসংক্ষেপ:
premise,street_addressধরনের এবং হাউজিং ও লজিং বিভাগের সব ধরনের জায়গার জন্য আশেপাশের আকর্ষণীয় পয়েন্টের হাই-লেভেল ওভারভিউ। -
ইলেকট্রিক ভেইকেল চার্জিং স্টেশনের সুযোগ-সুবিধার সারাংশ:
electric_vehicle_charging_stationধরনের জায়গার জন্য কাছাকাছি আকর্ষণীয় স্থানের হাই-লেভেল ওভারভিউ।
নিম্নলিখিত ভাষা ও অঞ্চলে আকর্ষণীয় স্থানের জন্য এলাকার সারসংক্ষেপ উপলভ্য:
| ভাষা | অঞ্চল |
|---|---|
| ইংরেজি | মার্কিন যুক্তরাষ্ট্র |
আশেপাশের এলাকার সারসংক্ষেপের জন্য অনুরোধ করুন
আপনি premise, street_address ধরনের জায়গা এবং হাউজিং ও লজিং বিভাগের সব ধরনের জায়গার জন্য আশেপাশের এলাকার সারসংক্ষেপের অনুরোধ করতে পারেন। আশেপাশের এলাকার সারসংক্ষেপের অনুরোধ করতে, fetchFields() কল করার সময়
neighborhoodSummary ফিল্ড অন্তর্ভুক্ত করুন:
await place.fetchFields({ fields: [ 'neighborhoodSummary', // Include other fields as needed. ], });
আশেপাশের এলাকার সারসংক্ষেপ পেতে neighborhoodSummary
প্রপার্টি ব্যবহার করুন। আশেপাশের এলাকার সারসংক্ষেপ পেতে, টেক্সট পেতে
neighborhoodSummary.content প্রপার্টি অ্যাক্সেস করুন।
নিম্নলিখিত স্নিপেট neighborhoodSummary-এর কন্টেন্ট ফিরিয়ে আনে:
if (place.neighborhoodSummary) { console.log("Place Neighborhood Summary:", place.neighborhoodSummary.overview.content); }
ইলেকট্রিক ভেইকেল চার্জিং স্টেশনের সুযোগ-সুবিধার সারসংক্ষেপের অনুরোধ করুন
আপনি electric_vehicle_charging_station ধরনের জায়গার জন্য ইলেকট্রিক ভেইকেল চার্জিং স্টেশনের সুযোগ-সুবিধার সারসংক্ষেপের অনুরোধ করতে পারেন। EVCS-এর সুযোগ-সুবিধার সারসংক্ষেপ চার ধরনের
সারসংক্ষেপ অফার করে: overview, coffee, restaurant এবং
store; এই কারণে ডেটা স্ট্রাকচার হল অবজেক্টের একটি অ্যারে, যার প্রতিটিতে
একটি সারসংক্ষেপ থাকে। ইলেকট্রিক ভেইকেল চার্জিং স্টেশন সংক্রান্ত সুযোগ-সুবিধার সারসংক্ষেপের অনুরোধ করতে, fetchFields() কল করার সময় evChargeAmenitySummary ফিল্ড অন্তর্ভুক্ত করুন:
await place.fetchFields({ fields: [ 'evChargeAmenitySummary', // Include other fields as needed. ], });
ইলেকট্রিক ভেইকেল চার্জিং স্টেশনের সুযোগ-সুবিধার সারসংক্ষেপ পেতে
evChargeAmenitySummary প্রপার্টি ব্যবহার করুন। সারসংক্ষেপ থেকে টেক্সট
পুনরুদ্ধার করতে, evChargeAmenitySummary.overview,
evChargeAmenitySummary.coffee, evChargeAmenitySummary.restaurant এবং
evChargeAmenitySummary.store প্রপার্টির content প্রপার্টি অ্যাক্সেস করুন।
নিম্নলিখিত স্নিপেটটি একটি evChargeAmenitySummary-এর কন্টেন্ট ফিরিয়ে আনে:
// overview, coffee, restaurant, store. if (place.evChargeAmenitySummary) { console.log("Place EVCS Amenity Summary:", place.evChargeAmenitySummary.overview.content); console.log("Coffee:", place.evChargeAmenitySummary.coffee.content); console.log("Restaurants:", place.evChargeAmenitySummary.restaurant.content); console.log("Stores:", place.evChargeAmenitySummary.store.content); }