Yes, you could create a Python AWS Lambda function to read the .txt files. Then depending on how big the documents are splitting them into passages and then send the documents to the  Inference API with a POST HTTP-Request.
You can the documentation here 1.