Skip to content

Commit

Permalink
feat: Tracking input tokens on embeddings store ingestor (langchain4j…
Browse files Browse the repository at this point in the history
  • Loading branch information
LangChain4j committed Oct 17, 2024
1 parent a8a2590 commit 5081b69
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/docs/tutorials/7-rag.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,13 @@ EmbeddingStoreIngestor ingestor = EmbeddingStoreIngestor.builder()

ingestor.ingest(document1);
ingestor.ingest(document2, document3);
ingestor.ingest(List.of(document4, document5, document6));
IngestionResult ingestionResult = ingestor.ingest(List.of(document4, document5, document6));
```

All `ingest()` methods in `EmbeddingStoreIngestor` return an `IngestionResult`.
The `IngestionResult` contains useful information, including `TokenUsage`,
which shows how many tokens were used for embedding.

Optionally, the `EmbeddingStoreIngestor` can transform `Document`s using a specified `DocumentTransformer`.
This can be useful if you want to clean, enrich, or format `Document`s before embedding them.

Expand Down

0 comments on commit 5081b69

Please sign in to comment.