convert_to_markdown
Convert PDFs, Office documents, HTML, and images to Markdown, with OCR and optional VLM image descriptions.
Instructions
Convert a document or image to Markdown.
Supports PDF, DOCX, PPTX, HTML, and image files (PNG/JPG/etc.).
Args: source: Local path, HTTP(S) URL, or data URI (data:;base64,...). ocr_languages: Override default OCR languages, e.g. ["en","zh"]. Defaults to env. enable_vlm: If True and a VLM endpoint is configured, generate richer image descriptions via an OpenAI-compatible API. Falls back to OCR text if unavailable. page_range: Optional (start, end) 1-indexed inclusive page range for PDFs. image_caption_mode: How to represent pictures in markdown: - "skip": placeholder only - "ocr_text": picture's OCR'd text (default) - "vlm_description": VLM-generated description (requires enable_vlm)
Returns: ConvertMarkdownResult as dict: {markdown, num_pages, num_tables, num_pictures, source_type, warnings}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| enable_vlm | No | ||
| page_range | No | ||
| ocr_languages | No | ||
| image_caption_mode | No | ocr_text |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||