async def test_embed_many_with_some_empty(self, model):
        """Test embedding of a mix of empty and non-empty texts."""
        mock_embedding = [0.1, 0.2, 0.3] * 512
        mock_response = CreateEmbeddingResponse(
            object="list",
            data=[
                Embedding(
                    object="embedding",
                    embedding=mock_embedding,
                    index=0
                )
            ],
            model="text-embedding-3-small",
            usage={"prompt_tokens": 5, "total_tokens": 5}
        )

        with patch.object(model._client.embeddings, 'create', new_callable=AsyncMock) as mock_create:
            mock_create.return_value = mock_response

            texts = ["", "Text 2"]
            result = await model.embed_many(texts)

            # Verify the result
            assert isinstance(result, list)
            assert len(result) == 2
            assert all(len(vec) == 1536 for vec in result)
            assert all(v == 0.0 for v in result[0])  # First vector should be all zeros
            assert result[1] == mock_embedding  # Second vector should be the real embedding

            # Verify the API call only sends the non-empty text
            mock_create.assert_called_once_with(
                input=["Text 2"],  # Only non-empty text
                model="text-embedding-3-small",
                encoding_format="float",
            )
Test embedding of a mix of empty and non-empty texts.
backend/tests/platform/embedding_models/test_openai_text2vec.py