Adds a document file path to a session.
(self, session_id: str, file_path: str)
| 300 | } |
| 301 | |
| 302 | def add_document_to_session(self, session_id: str, file_path: str) -> int: |
| 303 | """Adds a document file path to a session.""" |
| 304 | conn = sqlite3.connect(self.db_path) |
| 305 | cursor = conn.execute( |
| 306 | "INSERT INTO session_documents (session_id, file_path) VALUES (?, ?)", |
| 307 | (session_id, file_path) |
| 308 | ) |
| 309 | doc_id = cursor.lastrowid |
| 310 | conn.commit() |
| 311 | conn.close() |
| 312 | print(f"📄 Added document '{file_path}' to session {session_id[:8]}...") |
| 313 | return doc_id |
| 314 | |
| 315 | def get_documents_for_session(self, session_id: str) -> List[str]: |
| 316 | """Retrieves all document file paths for a given session.""" |