if response.status_code >= 500:
            raise Exception(f"EdenAI Server: Error {response.status_code}")
        elif response.status_code >= 400:
            raise ValueError(f"EdenAI received an invalid payload: {response.text}")
        elif response.status_code != 200:
            raise Exception(
                f"EdenAI returned an unexpected response with status "
                f"{response.status_code}: {response.text}"
            )
        temp = response.json()
        embeddings = []
        for embed_item in temp[self.provider]["items"]:
            embedding = embed_item["embedding"]
            embeddings.append(embedding)
        return embeddings
[docs]    def embed_documents(self, texts: List[str]) -> List[List[float]]:
        """Embed a list of documents using EdenAI.
        Args:
            texts: The list of texts to embed.
        Returns:
            List of embeddings, one for each text.
        """
        return self._generate_embeddings(texts)
[docs]    def embed_query(self, text: str) -> List[float]:
        """Embed a query using EdenAI.
        Args:
            text: The text to embed.
        Returns:
            Embeddings for the text.
        """
        return self._generate_embeddings([text])[0]