From 5082460cc01ca3327bb1c1c354ecc922457e9628 Mon Sep 17 00:00:00 2001 From: begoniezhao Date: Tue, 14 Apr 2026 16:07:06 +0800 Subject: [PATCH] fix(embedding): remove hardcoded TruncatePromptTokens in BatchEmbed Remove the hardcoded TruncatePromptTokens: 512 limit from WeKnoraCloud BatchEmbed to allow the API to use its default truncation behavior, avoiding unexpected truncation of longer input texts. Co-Authored-By: Claude Opus 4.6 (1M context) --- internal/models/embedding/weknoracloud.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/models/embedding/weknoracloud.go b/internal/models/embedding/weknoracloud.go index 158d7af6..b49bfcb2 100644 --- a/internal/models/embedding/weknoracloud.go +++ b/internal/models/embedding/weknoracloud.go @@ -78,7 +78,7 @@ func (e *WeKnoraCloudEmbedder) Embed(ctx context.Context, text string) ([]float3 } func (e *WeKnoraCloudEmbedder) BatchEmbed(ctx context.Context, texts []string) ([][]float32, error) { - reqBody := weKnoraCloudEmbedRequest{Model: e.effectiveModelName(), Input: texts, TruncatePromptTokens: 512} + reqBody := weKnoraCloudEmbedRequest{Model: e.effectiveModelName(), Input: texts} bodyBytes, err := json.Marshal(reqBody) if err != nil { return nil, fmt.Errorf("weknoracloud embedder: marshal: %w", err)