Image Transcribe Document Agent
Code
1from kern.agent import Agent2from kern.media import Image3from kern.models.mistral.mistral import MistralChat45agent = Agent(6 model=MistralChat(id="pixtral-12b-2409"),7 markdown=True,8)910agent.print_response(11 "Transcribe this document.",12 images=[13 Image(url="https://ciir.cs.umass.edu/irdemo/hw-demo/page_example.jpg"),14 ],15)Usage
Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateSet your API key
1export MISTRAL_API_KEY=xxxInstall dependencies
1uv pip install -U mistralai kern-aiRun Agent
1python cookbook/11_models/mistral/image_transcribe_document_agent.py