feat: Use num_ctx instead of truncate for embedding truncation

main
begoniezhao 2026-02-04 14:17:18 +08:00
parent 0e1d08a14d
commit 4610a4d1ee
1 changed files with 3 additions and 1 deletions

View File

@ -95,7 +95,9 @@ func (e *OllamaEmbedder) BatchEmbed(ctx context.Context, texts []string) ([][]fl
// Set truncation parameters
if e.truncatePromptTokens > 0 {
req.Options["truncate"] = e.truncatePromptTokens
req.Options["num_ctx"] = e.truncatePromptTokens
truncate := true
req.Truncate = &truncate
}
// Send request