(doc: Document)
| 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: |
nothing calls this directly
no outgoing calls
no test coverage detected