MCPcopy
hub / github.com/PromtEngineer/localGPT / add_document_to_session

Method add_document_to_session

backend/database.py:302–313  ·  view source on GitHub ↗

Adds a document file path to a session.

(self, session_id: str, file_path: str)

Source from the content-addressed store, hash-verified

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."""

Callers 1

handle_file_uploadMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected