{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/scripts\/pipeline\/pipeline.py",
"offset": 525,
"limit": 50
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/scripts\/pipeline\/pipeline.py",
"content": " print(f\"Embedded {count} chunks\")\n\n elif args.command == \"semantic\":\n # Run semantic analysis on a specific document\n if not args.file_path:\n print(\"Error: semantic command requires a document ID\")\n return\n try:\n doc_id = int(args.file_path)\n except ValueError:\n print(\"Error: document ID must be an integer\")\n return\n\n semantic_step = SemanticStep(db)\n # Get document text\n text = semantic_step._get_document_text(doc_id)\n if not text:\n print(f\"No text found for document {doc_id}\")\n return\n\n result = semantic_step.execute(doc_id, text, use_anthropic=SEMANTIC_USE_ANTHROPIC)\n print(f\"Semantic analysis complete: {result}\")\n\n elif args.command == \"semantic-queue\":\n # Process pending items from semantic queue\n semantic_step = SemanticStep(db)\n result = semantic_step.process_queue(\n limit=int(args.file_path) if args.file_path else 5,\n use_anthropic=SEMANTIC_USE_ANTHROPIC,\n )\n print(f\"Semantic queue processed: {result}\")\n\n elif args.command == \"enrich-entities\":\n # Enrich entity descriptions via Ollama\n limit = int(args.file_path) if args.file_path else DEFAULT_LIMIT\n model = get_step_model(\"enrich\")\n\n print(f\"Entity Description Enrichment (limit={limit}, model={model})\")\n print(\"-\" * 50)\n\n enrich_step = EntityEnrichStep()\n\n # Show current stats\n stats = enrich_step.get_stats()\n print(f\"Entities total: {stats['total']}\")\n print(f\"Need enrichment: {stats['needs_enrichment']}\")\n print(f\"Already enriched: {stats['enriched']}\")\n if stats['avg_length']:\n print(f\"Avg description length: {int(stats['avg_length'])} chars\")\n print()",
"numLines": 50,
"startLine": 525,
"totalLines": 665
}
}
}