MCPcopy Create free account
hub / github.com/AsyncFuncAI/deepwiki-open / _embedding_vector_length

Method _embedding_vector_length

api/data_pipeline.py:858–871  ·  view source on GitHub ↗
(doc: Document)

Source from the content-addressed store, hash-verified

856 List[Document]: List of Document objects
857 """
858 def _embedding_vector_length(doc: Document) -> int:
859 vector = getattr(doc, "vector", None)
860 if vector is None:
861 return 0
862 try:
863 if hasattr(vector, "shape"):
864 if len(vector.shape) == 0:
865 return 0
866 return int(vector.shape[-1])
867 if hasattr(vector, "__len__"):
868 return int(len(vector))
869 except Exception:
870 return 0
871 return 0
872
873 # Handle backward compatibility
874 if embedder_type is None and is_ollama_embedder is not None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected