def search_for_destination_images(query: str) -> list: """ Searches DuckDuckGo Images for the query and returns a list of image URLs. """ try: res = requests.get(f"https://duckduckgo.com/?q={query.replace(' ', '+')}&iar=images&iax=images") soup = BeautifulSoup(res.text, "html.parser") imgs = soup.select("img.tile--img__img")[:5] return [img.get("src") for img in imgs if img.get("src")] except Exception as e: return [f"Image search failed: {e}"] __ __