Add ids to metadata if absent, since some vecdbs don't like having blank ids.
(self, documents: Sequence[Document])
| 243 | return stringify(result) |
| 244 | |
| 245 | def maybe_add_ids(self, documents: Sequence[Document]) -> None: |
| 246 | """Add ids to metadata if absent, since some |
| 247 | vecdbs don't like having blank ids.""" |
| 248 | for d in documents: |
| 249 | if d.metadata.id in [None, ""]: |
| 250 | d.metadata.id = ObjectRegistry.new_id() |
| 251 | |
| 252 | @abstractmethod |
| 253 | def similar_texts_with_scores( |
no test coverage detected