fix(agent): adaptively set video embedding frame count based on aspect ratio (#477)

* fix(agent): adaptively set video embedding frame count based on aspect ratio

Adjust sampled video frame counts between 15 and 14 based on the video's aspect ratio. Standard aspect ratios (1:1, 4:3, 3:4, 16:9, 9:16, 21:9) stay within the 2048 token signature bucket when using 15 frames, while non-standard or custom aspect ratios use 14 frames to guarantee that sequence length never exceeds 2048 tokens, preventing out-of-memory errors on the embedding server.

* feat(agent): persist video chunk embeddings incrementally and resume on retry (#478)
This commit is contained in:
Yiling-J
2026-10-16 08:36:51 +08:00
committed by yiling
parent 6cc90bf973
commit 1a46f63160
7 changed files with 496 additions and 40 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ export class TextEmbeddingService {
}
}
const signal = options?.signal ?? AbortSignal.timeout(5000)
const signal = options?.signal ?? AbortSignal.timeout(15000)
let result: TextEmbeddingResult
if (provider === 'gemma-embedding-2-openai') {