MCPcopy
hub / github.com/stanford-oval/storm / encode

Method encode

knowledge_storm/encoder.py:112–122  ·  view source on GitHub ↗

Public method to get embeddings for the given texts. Args: texts (Union[str, List[str]]): A single text string or a list of text strings to embed. Returns: np.ndarray: The array of embeddings.

(self, texts: Union[str, List[str]], max_workers: int = 5)

Source from the content-addressed store, hash-verified

110 return token_usage
111
112 def encode(self, texts: Union[str, List[str]], max_workers: int = 5) -> np.ndarray:
113 """
114 Public method to get embeddings for the given texts.
115
116 Args:
117 texts (Union[str, List[str]]): A single text string or a list of text strings to embed.
118
119 Returns:
120 np.ndarray: The array of embeddings.
121 """
122 return self._get_text_embeddings(texts, max_workers=max_workers)
123
124 def _get_single_text_embedding(self, text):
125 response = litellm.embedding(

Calls 1

_get_text_embeddingsMethod · 0.95

Tested by

no test coverage detected