Friday, 25 April 2025

Kickstart Your GenAI Journey with Amazon Bedrock & Boto3 — How to Send Files, Handle Unsupported Formats & Start Exploring

✅ No S3 buckets
✅ No web frameworks
✅ Just plain Python, a file, and a smart AI agent
✅ BONUS: Learn how to handle Excel/Word files even if they're not supported (yet)

Hey folks 👋

If you're curious about Generative AI and wondering how to get your hands dirty — this blog is for you.

I created this guide for one reason:

To help beginners take their first step into building GenAI apps on AWS — with zero friction.

You won’t need fancy setups or cloud storage. Just give this a file, a prompt, and let Amazon Bedrock Agents do the magic.

This is a simple, clear path to:

  • 📁 Upload a file (PDF or TXT)

  • 💬 Ask a question or request

  • 🤖 Get a smart answer from a GenAI model (like Claude)

And even better — I’ll show you how to work with unsupported formats like Excel or Word by extracting the text yourself.

This is not the only way — it’s just to help you get started. Once you get the hang of it, you can write your own code to support any file format you like!

Let’s begin your GenAI journey 🚀

🧩 What You’ll Learn

  • ✅ Send PDF or text files to Amazon Bedrock Agents using Boto3
  • ✅ Handle multiple files in one session
  • ✅ ✨ BONUS: How to deal with Excel, Word, or other unsupported file types
  • ✅ Run everything locally in one script — no server needed

🛠️ What You Need

✅ AWS Account

Create one here

✅ AWS CLI Configured

 Windows? Download and install AWS CLI for Windows first.

✅ Python Environment
Install required packages:


🗂 Folder Structure

🔐 Your .env File

Add your AWS region and Bedrock Agent info:
.env file :

🧠 The Main Python Script

This script sends one or more files to a Bedrock Agent and prints the smart response.

main.py file :



📄 What If My File Is Excel or Word?

Amazon Bedrock doesn’t currently support files like:

  • .xlsx (Excel)

  • .docx (Word)

  • .csv, .pptx, etc.

But don’t worry — you can still use them by extracting the text and sending that in your prompt!

✅ Example: Convert Excel to Text



✅ Example: Convert Word to Text

🎓 This technique gives you full control — you can write your own code to support any format you want.

🎯 Recap

✅ Send PDF or text files to Bedrock Agents directly
✅ Get AI-powered summaries and insights
✅ Handle unsupported files by extracting text
✅ Customize and extend the code as you grow

This is just the beginning of your GenAI journey — a simple script to get you started, explore possibilities, and build bigger things.

💡 What's Next?

With this foundation, you can build:

  • Resume or CV screeners

  • Research paper summarizers

  • Legal contract explainers

  • Customer support assistants

The tools are in your hands now. Tweak it. Expand it. Make it your own.

Contact us today: sales@cloud.in or +91-020-66080123

The blog is written by Shubham Raut (Junior Developer @Cloud.in)

No comments:

Post a Comment

Kickstart Your GenAI Journey with Amazon Bedrock & Boto3 — How to Send Files, Handle Unsupported Formats & Start Exploring

✅ No S3 buckets ✅ No web frameworks ✅ Just plain Python, a file, and a smart AI agent ✅ BONUS: Learn how to handle Excel/Word files even if ...