Skip to main content
This guide helps you migrate from Chunkr’s legacy HTML/Markdown dual-generation system to the new unified format approach.

What Changed

Chunkr has consolidated content generation to improve performance and simplify the API.

Before (Legacy)

Python

After (New)

Python

Key Changes

The purpose of segment.content has completely changed - it now contains generated HTML/Markdown instead of OCR text

Migration Priority

🚨 CRITICAL - Immediate Action Required

1. Pipeline.Chunkr Table Processing Default Change

Impact: Tables no longer generate AI-enhanced markdown by default
Python
Who’s affected:
  • Applications using Pipeline.Chunkr with default table config
  • Expecting AI-generated segment.markdown for tables
Who’s not affected:
  • Applications with explicit table configuration

2. OCR Text Access Breaking Change

Impact: Applications accessing OCR text from segment.content will break
Python
Who’s affected:
  • Applications reading segment.content expecting OCR text

💡 LOW - Performance Optimization

3. Update to New Content Access Pattern

Impact: Performance improvement and future-proofing
Python
Who’s affected: All applications (optional upgrade)

Quick Self-Assessment

Am I affected by Critical Issue #1?
  • Do I use Pipeline.Chunkr (layout analysis)?
  • Do I process tables without explicit configuration?
  • Do I expect segment.markdown to contain AI-enhanced table content?
  • If yes to all: Add explicit table configuration immediately
Am I affected by Medium Issue #2?
  • Do I access segment.content anywhere in my code?
  • Do I expect segment.content to contain OCR text?
  • If yes to both: Update to segment.text

Migration Steps

1

Update Configuration Format

Replace legacy html and markdown fields with format and strategy:
Python
2

Update Content Access

Change how you access OCR text:
Python
3

Update Embed Sources

Replace format-specific embed sources:
Python
Content refers to the generated content based on your chosen format
4

Test Thoroughly

Verify that:
  • Table processing generates expected content
  • OCR text is correctly accessed from segment.text
  • Embed fields contain expected content
  • Chunk lengths are calculated correctly

Complete Migration Example

Legacy Configuration

Python

New Configuration

Python

Backward Compatibility

The API maintains backward compatibility:

Configuration Deserialization

Legacy configurations still work:
Python
Resolution logic:
  1. If both html and markdown use LLM, prefer the default format for that segment type
  2. If one uses LLM and one uses Auto, use the LLM one
  3. If only one is set, use that format and strategy

Response Fields

All fields remain populated:
Python

Benefits of Migration

  • Reduced processing time: Generate only the format you need
  • Lower resource usage: Single format generation vs dual format
  • Faster API responses: Less content to transfer
  • Simplified configuration: Choose format once instead of multiple strategies
  • Better resource allocation: Focus processing on chosen format
  • Clearer content contracts: Know exactly what format you’ll receive
  • Unified content access: One field for generated content
  • Clearer field purposes: content for generated, text for OCR
  • Easier embed configuration: Use Content instead of format-specific sources

Common Migration Patterns

Pattern 1: Tables with HTML

Python

Pattern 2: Text with Markdown

Python

Pattern 3: Mixed Formats

Python

Troubleshooting

Problem: Using default config, tables aren’t processed with LLMSolution: Explicitly configure table processing:
Problem: Expected OCR text but getting HTML/MarkdownSolution: Use segment.text for OCR text:
Problem: Using deprecated HTML or Markdown embed sourcesSolution: Update to Content:

Need Help?

If you encounter issues during migration:

Migration Checklist

  • Updated all segment_processing configs to use format and strategy
  • Changed OCR text access from segment.content to segment.text
  • Updated embed_sources from HTML/Markdown to Content
  • Added explicit table configuration if using default settings
  • Tested with sample documents
  • Verified chunk embed content is correct
  • Updated documentation and examples
  • Deployed and monitored in production