III–V Indium Arsenide (InAs) nanowire photodetectors have attracted intensive research attention due to their high carrier mobility, direct and narrow bandgap, and nanoscale dimensions, offering immense potential in nanoscale optoelectronics, particularly for applications in photonic integrated circuits. Despite extensive studies on the properties of InAs nanowires, their photoresponse remains intricate, displaying bipolar behavior (i.e., positive and negative photoresponse) within the same device under varying conditions. However, the underlying driving mechanism remains unclear. In this work, we have systematically studied the transition between the negative photoresponse and positive photoresponse in the InAs nanowire photodetector under different conditions. We found the bipolar photoresponse is directly related to the occupation status of the surface trap states, and it could be effectively regulated by the gate voltage, power intensity, as well as the illumination duration. Furthermore, we developed a waveguide-integrated InAs nanowire photodetector using electron photoresist with an optical loss as low as 0.122 dB/μm. This achievement underscores its potential for application in photonic integrated photodetectors, laying the groundwork for future integration of InAs nanowire photodetectors into photonic integrated circuits.