node_parser = SimpleNodeParser.from_defaults(chunk_size=chunk_size, chunk_overlap=20) content_nodes = node_parser.get_nodes_from_documents([document]) index = VectorStoreIndex(content_nodes, storage_context=storage_context, service_context=service_context)
for result in embedding_results: # NOTE: keep text in metadata dict since there's no special field in # Supabase Vector. metadata_dict = node_to_metadata_dict( result.node, remove_text=False, flat_metadata=self.flat_metadata ) data.append((result.id, result.embedding, metadata_dict)) ids.append(result.id)
self._collection.upsert(records=data, skip_adapter=True)