{
"event": "PreToolUse",
"tool_name": "Grep",
"tool_input": {
"pattern": "get_chunks_for_embedding",
"path": "\/opt\/scripts\/pipeline",
"output_mode": "content",
"-A": 10
}
}
{
"tool_response": {
"mode": "content",
"numFiles": 0,
"filenames": [],
"content": "db.py:111: def get_chunks_for_embedding(self, limit=100):\n\/opt\/scripts\/pipeline\/db.py-112- \"\"\"Get chunks that need embeddings.\"\"\"\n\/opt\/scripts\/pipeline\/db.py-113- cursor = self.execute(\n\/opt\/scripts\/pipeline\/db.py-114- \"\"\"SELECT c.id, c.content, c.document_id\n\/opt\/scripts\/pipeline\/db.py-115- FROM chunks c\n\/opt\/scripts\/pipeline\/db.py-116- WHERE c.qdrant_id IS NULL\n\/opt\/scripts\/pipeline\/db.py-117- ORDER BY c.created_at\n\/opt\/scripts\/pipeline\/db.py-118- LIMIT %s\"\"\",\n\/opt\/scripts\/pipeline\/db.py-119- (limit,),\n\/opt\/scripts\/pipeline\/db.py-120- )\n\/opt\/scripts\/pipeline\/db.py-121- results = cursor.fetchall()\n--\nembed.py:101: chunks = db.get_chunks_for_embedding(limit)\n\/opt\/scripts\/pipeline\/embed.py-102- db.log(\"INFO\", f\"Found {len(chunks)} chunks to embed\")\n\/opt\/scripts\/pipeline\/embed.py-103-\nembed.py-104- if not chunks:\n\/opt\/scripts\/pipeline\/embed.py-105- return 0\n\/opt\/scripts\/pipeline\/embed.py-106-\n\/opt\/scripts\/pipeline\/embed.py-107- embedded = 0\nembed.py-108- for chunk in chunks:\n\/opt\/scripts\/pipeline\/embed.py-109- embedding = get_embedding(chunk[\"content\"])\n\/opt\/scripts\/pipeline\/embed.py-110-\nembed.py-111- if not embedding:",
"numLines": 23
}
}