def Search__duckduckgo(query: str, max_results: int = 20) -> list:
    """
    Search the query on DuckDuckGo and return the results.
    """
    try:
        from duckduckgo_search import DDGS

        return list(DDGS().text(query, max_results=max_results))
    except:
        return "An exception occurred"

    Search the query on DuckDuckGo and return the results.
    
src/upsonic/tools_server/server/function_tools.py