The e-commerce giant is turning its in-house AI shopping tech into a service for retailers, taking on OpenAI, Google and others in the race to own AI-driven commerce.