INNER CODE UNIT · Python

observe

pathwaycom/llm-app · serviette/server/main.py:113

    def observe(self, stats: dict[str, Any]) -> dict[str, Any]:
        import time

        key = (
            stats.get("chunks"),
            stats.get("documents"),
            stats.get("last_indexed_at"),
        )
        if self._snapshot is None:
            self._snapshot = key  # first look: nothing to compare against
        elif key != self._snapshot:
            self._snapshot = key
            self._changed_at = int(time.time())
        stored = stats.get("last_indexed_at")
        if self._changed_at is not None and (
            stored is None or self._changed_at > stored
        ):
            stats["last_indexed_at"] = self._changed_at

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…