Investors have shifted against increased AI spending, but opportunities remain.