{"record":{"id":"4abd093bdde4e624","repo":"RyanCodrai/turbovec","slug":"texts-metadatas-and-ids-must-all-have-the-same-l","errorCode":null,"errorMessage":"texts, metadatas, and ids must all have the same length","messagePattern":"texts, metadatas, and ids must all have the same length","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/langchain.py","lineNumber":282,"sourceCode":"    ) -> list[str]:\n        texts_list = list(texts)\n        if not texts_list:\n            return []\n        if metadatas is None:\n            metadatas = [{} for _ in texts_list]\n        else:\n            # Materialize once so a generator (or other one-shot iterable)\n            # survives the length check and the storage loop below.\n            metadatas = list(metadatas)\n        if ids is None:\n            ids = [str(uuid.uuid4()) for _ in texts_list]\n        else:\n            # Fresh list[str] (whatever container the caller passed),\n            # per-entry None -> UUID, any other non-str id -> TypeError.\n            # Raised here, before embedding or any store mutation.\n            ids = self._normalize_ids(list(ids))\n        if len(metadatas) != len(texts_list) or len(ids) != len(texts_list):\n            raise ValueError(\"texts, metadatas, and ids must all have the same length\")\n\n        vectors = np.asarray(self._embedding.embed_documents(texts_list), dtype=np.float32)\n        self._check_embedded_batch(vectors, len(texts_list))\n        return self._store_texts_and_vectors(texts_list, vectors, metadatas, ids)\n\n    async def aadd_texts(\n        self,\n        texts: Iterable[str],\n        metadatas: list[dict] | None = None,\n        ids: list[str] | None = None,\n        **_: Any,\n    ) -> list[str]:\n        texts_list = list(texts)\n        if not texts_list:\n            return []\n        if metadatas is None:\n            metadatas = [{} for _ in texts_list]\n        else:","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/langchain.py#L264-L300","documentation":"Raised in add_texts (and aadd_texts) when texts, metadatas, and ids are supplied but their lengths differ. A length mismatch would misalign texts with their metadata and ids in the store, so it is rejected before embedding or any mutation.","triggerScenarios":"Thrown at turbovec-python/python/turbovec/langchain.py:282 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass metadatas/ids lists of exactly the same length as texts, or omit them (metadatas default to {}, ids to fresh UUIDs).","Check the caller's data assembly — a zip/dedup step may have dropped entries.","Catch the ValueError in ingestion code to validate batch construction."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ccab9f325e6ce2a270a87daf01ae4e443bcf2d49","analyzedAt":"2026-09-06T08:39:18.516Z","contentChangedAt":"2026-09-06T08:39:18.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}