Skip to content

armgit / camel

Public Imported from GitHub
0

๐Ÿซ CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

2.1 KB
Raw Blame

CAMEL-AI OCR Demo (w/ Mistral)

A simple Streamlit app to extract and summarize text from PDFs and images using the Mistral OCR API, fully powered by the CAMEL-AI framework.


๐Ÿš€ Features

  • Drag & drop PDF or image upload (up to 200MB)
  • Live preview (PDF or image) in the sidebar
  • One-click OCR extraction via Mistral OCR
  • Nicely formatted OCR result in markdown
  • Optional LLM-powered summary using CAMEL-AIโ€™s agents
  • Easy Mistral API key input (sidebar)
  • Modern Streamlit UI, ready to customize

๐Ÿ› ๏ธ Requirements

Install all dependencies in a clean virtualenv.


๐Ÿ“ฆ Quick Install

# 1. (Recommended) Create and activate virtualenv
python3.12 -m venv .venv
source .venv/bin/activate

# 2. Clone this demo repo or copy app.py and requirements.txt
# (Assume youโ€™re in the right directory)

# 3. Install dependencies
pip install --upgrade pip
pip install -r requirements.txt

๐Ÿ“ Usage

  1. Get your Mistral API Key
  2. Run the Streamlit app:
    streamlit run app.py
    
  3. Open the app in your browser at http://localhost:8501
  4. Paste your API key in the sidebar, upload a PDF/image, and extract text!

๐Ÿ“ File Structure

app.py            # Main Streamlit app
README.md         # This file
requirements.txt  # Python dependencies

๐Ÿ”ง Troubleshooting

  • MistralReader import error? Make sure you have camel-ai==0.2.61 installed (see requirements.txt).
  • No module named mistralai? Install with pip install mistralai.
  • Python version errors? Use Python 3.10 or 3.12 only.

requirements.txt

streamlit
pillow
mistralai
camel-ai[all]==0.2.61