Skip to content

Auto truncate for vertex embedding is broken by TokenCountBatchingStrategy #1831

@GregoireW

Description

@GregoireW

Bug description

I try to use vertex embedding and did test big document. I did set the auto-truncate to true.
This correspond to this options:

But I got an exception from TokenCountBatchingStrategy (

)

What to do in this situation ?

Environment

Spring AI 1.0.0-M4 / jdk21

Steps to reproduce

Use vertex embedding with the "auto truncate" option, and test with a large payload.

Expected behavior

Success or at least some way in the documentation to make it works.

Minimal Complete Reproducible example

var document = new Document("go ".repeat(50000));
vectorStore.add(List.of(document));

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingvertex

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions