Apple Inc. is in talks to build Google’s Gemini artificial intelligence engine into the iPhone, according to people familiar with the situation, setting the stage for a blockbuster agreement that would shake up the AI industry.