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)
| 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( |
no test coverage detected