(self, session_id: str)
| 993 | self.send_json_response({'error':str(e)}, status_code=500) |
| 994 | |
| 995 | def handle_get_session_indexes(self, session_id: str): |
| 996 | try: |
| 997 | idx_ids = db.get_indexes_for_session(session_id) |
| 998 | indexes = [] |
| 999 | for idx_id in idx_ids: |
| 1000 | idx = db.get_index(idx_id) |
| 1001 | if idx: |
| 1002 | # Try to populate metadata for older indexes that have empty metadata |
| 1003 | if not idx.get('metadata') or len(idx['metadata']) == 0: |
| 1004 | print(f"🔍 Attempting to infer metadata for index {idx_id[:8]}...") |
| 1005 | inferred_metadata = db.inspect_and_populate_index_metadata(idx_id) |
| 1006 | if inferred_metadata: |
| 1007 | # Refresh the index data with the new metadata |
| 1008 | idx = db.get_index(idx_id) |
| 1009 | indexes.append(idx) |
| 1010 | self.send_json_response({'indexes': indexes, 'total': len(indexes)}) |
| 1011 | except Exception as e: |
| 1012 | self.send_json_response({'error': str(e)}, status_code=500) |
| 1013 | |
| 1014 | def handle_delete_index(self, index_id: str): |
| 1015 | """Remove an index, its documents, links, and the underlying LanceDB table.""" |
no test coverage detected