You cannot link python code directly to App Inventor Mohamed.
Try these App Inventor chat bot examples using AI Blocks: