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

Method get_session

backend/database.py:141–155  ·  view source on GitHub ↗

Get a specific session

(self, session_id: str)

Source from the content-addressed store, hash-verified

139 return sessions
140
141 def get_session(self, session_id: str) -> Optional[Dict]:
142 """Get a specific session"""
143 conn = sqlite3.connect(self.db_path)
144 conn.row_factory = sqlite3.Row
145
146 cursor = conn.execute('''
147 SELECT id, title, created_at, updated_at, model_used, message_count
148 FROM sessions
149 WHERE id = ?
150 ''', (session_id,))
151
152 row = cursor.fetchone()
153 conn.close()
154
155 return dict(row) if row else None
156
157 def add_message(self, session_id: str, content: str, sender: str, metadata: Dict = None) -> str:
158 """Add a message to a session"""

Callers 5

handle_get_sessionMethod · 0.80
handle_create_sessionMethod · 0.80
handle_session_chatMethod · 0.80
handle_rename_sessionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected