Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/core/src/embedding/voyageai-embedding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ export class VoyageAIEmbedding extends Embedding {
const modelInfo = supportedModels[model];

if (modelInfo) {
// If dimension is a string (indicating variable dimension), use default value 1024
if (typeof modelInfo.dimension === 'string') {
this.dimension = 1024; // Default dimension
// Parse default dimension from string like "1024 (default), 256, 512, 2048"
const match = modelInfo.dimension.match(/^(\d+)/);
this.dimension = match ? parseInt(match[1], 10) : 1024;
Comment on lines +33 to +35
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description/test plan mentions fixing default dimensions for models like voyage-4-nano (512 default), but this file’s getSupportedModels() does not include that model (and all current string-form dimensions start with 1024). As a result, voyage-4-nano will still hit the unknown-model fallback and keep using 1024, so the reported schema mismatch would persist. Consider adding the missing model(s) to getSupportedModels() (with the correct dimension string) or introducing a safer fallback for unknown models (e.g., detect dimension from an embed response length).

Copilot uses AI. Check for mistakes.
} else {
this.dimension = modelInfo.dimension;
}
Expand Down
Loading