Bipolar is thought to be genetic but some more recent studies suggest that environmental factors - stable, loving home with consistent discipline, healthy food, consistent routine, close monitoring of vitamin B and D levels - can help reduce the chances of a child ever expressing the bipolar gene.
This site has some helpful information:
http://www.webmd.com/bipolar-disorder/guide/bipolar-disorder-whos-at-risk
It would be worthwhile to discuss this concern with your ob-gyn
and also your psychiatrist.