The present invention relates to compounds of formula I, methods of using these compounds as Trk inhibitors, and pharmaceutical compositions containing such compounds. These compounds can be used to treat, prevent or ameliorate diseases or conditions, such as cancer or infection.本發明關於式I化合物、使用這些化合物作為Trk抑制劑的方法、以及包含此類化合物的藥物組合物。這些化合物可用於治療、預防或改善疾病或病症,例如癌症或感染。