MCPcopy Create free account
hub / github.com/alibaba/zvec / embed

Method embed

python/zvec/extension/embedding_function.py:134–147  ·  view source on GitHub ↗

Generate a sparse embedding for the input data. Args: input (MD): Multimodal input data to embed. Can be: - TEXT (str): Text string - IMAGE (str | bytes | np.ndarray): Image file path, raw bytes, or array - AUDIO (str | bytes | np.

(self, input: MD)

Source from the content-addressed store, hash-verified

132
133 @abstractmethod
134 def embed(self, input: MD) -> SparseVectorType:
135 """Generate a sparse embedding for the input data.
136
137 Args:
138 input (MD): Multimodal input data to embed. Can be:
139 - TEXT (str): Text string
140 - IMAGE (str | bytes | np.ndarray): Image file path, raw bytes, or array
141 - AUDIO (str | bytes | np.ndarray): Audio file path, raw bytes, or array
142
143 Returns:
144 SparseVectorType: Mapping from dimension index to non-zero weight.
145 Only dimensions with non-zero values are included.
146 """
147 ...

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected