From b13a10bbcca4a85249c8bd3c5ec127d3847c9b11 Mon Sep 17 00:00:00 2001 From: gabrielluizsf Date: Fri, 24 May 2024 09:11:08 -0300 Subject: [PATCH] using the chunkSize value provided in the opts --- embedding.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/embedding.go b/embedding.go index 723e825..1a03192 100644 --- a/embedding.go +++ b/embedding.go @@ -77,8 +77,8 @@ type ChunkTextOpts struct { // ChunkText splits the input text into chunks of specified size. func ChunkText(opts ChunkTextOpts) []string { - var chunkSize int - if opts.ChunkSize <= 0 { + chunkSize := opts.ChunkSize + if chunkSize <= 0 { chunkSize = 512 }