def test_request_success(self):
        """Ensures that _request returns JSON response on success."""
        payload = {"prompt": "Hello"}
        response_json = {"choices": [{"text": "Hi"}]}
        response_mock = Mock()
        response_mock.json.return_value = response_json
        response_mock.status_code = 200

        self.client._client.post.return_value = response_mock

        result = self.client._request(payload)

        assert result == response_json
Ensures that _request returns JSON response on success.
llama-index-integrations/embeddings/llama-index-embeddings-oci-data-science/tests/test_oci_data_science_client.py