Are you referring to trading of resources or Trade Routes?
With either (but especially of resources), AI attitude has an affect, though an AI will do a trade route with you IF it would be to their advantage for either tourism or science purposes. They may base their trade routes destinations on their total gold profit, the NET profit (theirs minus yours), or the afore-mentioned tourism or science.
Re trade routes, you don't generally WANT them to: the trade route OWNER will usually get much more gold from their trade route than you will. When you hover over a trade route in the trade route window, it will show you the yields and how they are derived (different resources, city income, trade-enhancing buildings (e.g., caravansary, market, bank, harbor), adjacent river, tech & tourism advantage, ....