Warren Buffett warned investors to be careful, calling out gambling in markets and the cost of AI