This is different to waht the poster is asking...you're talking about trading which is a must. Giving away techs is different.
Basically the factors I see are: difficulty level, timing, what tech they are asking for, and how friendly you want them to be.
On the easier settings, its simple, don't give away anything. On the harder ones then it'll vary on the other factors.
If its early game, I'll give away anything to anyone with the exception of alphabet. Later on, once I've established who I want to be friends with and who I want to kill then I'll decide wheter I want to give it to them or not. Generally, the harder the game, the more friendly you want the AI to be, thus the more often you'll have to give techs away. It sucks, but its the way to play.