| 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														        return [list(map(float, e)) for e in embeddings], embedding_used_tokens | 
														 | 
														 | 
														        return [list(map(float, e)) for e in embeddings], embedding_used_tokens | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														    def embed_query(self, text: str) -> list[float]: | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														        """Call out to ZhipuAI's embedding endpoint. | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														        Args: | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														            text: The text to embed. | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														        Returns: | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														            Embeddings for the text. | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														        """ | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														        return self.embed_documents([text])[0] | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														    def _calc_response_usage(self, model: str, credentials: dict, tokens: int) -> EmbeddingUsage: | 
														 | 
														 | 
														    def _calc_response_usage(self, model: str, credentials: dict, tokens: int) -> EmbeddingUsage: | 
													
													
												
													
														 | 
														 | 
														        """ | 
														 | 
														 | 
														        """ | 
													
													
												
													
														 | 
														 | 
														        Calculate response usage | 
														 | 
														 | 
														        Calculate response usage |