chore: auto-commit from dashboard
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""YouTube subtitle-download + note-creation endpoint."""
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
@@ -10,6 +11,8 @@ from pathlib import Path
|
||||
|
||||
import constants
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _clean_vtt(content):
|
||||
"""Convert VTT captions to plain text."""
|
||||
@@ -101,6 +104,16 @@ def _process_youtube(url):
|
||||
[sys.executable, str(constants.TOOLS_DIR / 'update_notes_index.py')],
|
||||
capture_output=True,
|
||||
)
|
||||
|
||||
# Index new note with Ollama semantic embeddings
|
||||
try:
|
||||
sys.path.insert(0, str(constants.BASE_DIR))
|
||||
from src.memory_search import index_file, MEMORY_DIR
|
||||
n = index_file(note_path)
|
||||
log.info("Ollama indexed %s (%d chunks)", filename, n)
|
||||
except Exception as e:
|
||||
log.warning("Ollama indexing failed for %s: %s", filename, e)
|
||||
|
||||
print(f"Created note: {filename}")
|
||||
return filename
|
||||
|
||||
|
||||
Reference in New Issue
Block a user