INNER CODE UNIT · Python

find

neuml/tldrstory · src/python/tldrstory/api.py:15

    def find(self, cur, query, request):
        """
        Executes query against embeddings index and/or SQLite, depending on the query.

        Args:
            cur: open database cursor
            query: query text
            request: FastAPI request

        Returns:
            query results
        """

        if not query:
            return cur.execute("SELECT id, 1.0 as score FROM articles ORDER BY date DESC LIMIT 100").fetchall()

        elif query.startswith("url:"):
            query = query.replace("url:", "")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…