Skip to content

Question about the Concatenate completion strategy for multi-page document #351

Description

@enoch3712

Discussed in #349

Originally posted by creukersVF July 18, 2025
Hello, I have a question about the usage of the concatenate completion strategy. I have a multi-page document (7 pages) loaded in with DocumentLoaderPyPdf() with vision enabled, resulting in a list of the pages with image data of each page.
Now with so much image data I hit the token limits of my LLM (Claude 3 haiku through Bedrock). For the classification I can get around this by providing a single page at a time, but with the extraction I want to provide the entire document to return a single extraction result based on my provided Contract. Here is where, from what I understood, the Concatenate completion strategy would come in. However, when I try to extract the content like this;

result = extractor_reading.extract(
    content,
    classified_contract,
    completion_strategy=CompletionStrategy.CONCATENATE,
    vision=True,
)

It throws in the following error;
ValueError: Maximum retries reached: Maximum retries reached with invalid JSON continuations

What am I doing wrong?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions