Skip to content
Prev Previous commit
Next Next commit
feat: update VoyageAI to latest models (v4, 3.5, rerank-2.5)
- Add voyage-4-large, voyage-4, voyage-4-lite embedding models
- Add voyage-3.5, voyage-3.5-lite embedding models
- Add rerank-2.5, rerank-2.5-lite reranking models
- Default embeddings model: voyage-3.5
- Default rerank model: rerank-2.5
- All models verified working with live API
  • Loading branch information
fzowl committed Mar 23, 2026
commit 1bf99c0628182b930df86b255e3505e50112b945
15 changes: 10 additions & 5 deletions apps/sim/blocks/blocks/voyageai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('VoyageAIBlock', () => {

it('should default to embeddings operation', () => {
const opBlock = VoyageAIBlock.subBlocks[0] as any
expect(opBlock.value()).toBe('embeddings')
expect(opBlock.value!()).toBe('embeddings')
})

it('should have embeddings-specific subBlocks with correct conditions', () => {
Expand Down Expand Up @@ -144,22 +144,27 @@ describe('VoyageAIBlock', () => {
expect(topKBlock!.mode).toBe('advanced')
})

it('should have all 6 embedding models in the dropdown', () => {
it('should have all embedding models in the dropdown', () => {
const modelBlock = VoyageAIBlock.subBlocks.find((sb) => sb.id === 'embeddingModel') as any
expect(modelBlock).toBeDefined()
const modelIds = modelBlock.options.map((o: any) => o.id)
expect(modelIds).toContain('voyage-4-large')
expect(modelIds).toContain('voyage-4')
expect(modelIds).toContain('voyage-4-lite')
expect(modelIds).toContain('voyage-3.5')
expect(modelIds).toContain('voyage-3.5-lite')
expect(modelIds).toContain('voyage-3-large')
expect(modelIds).toContain('voyage-3')
expect(modelIds).toContain('voyage-3-lite')
expect(modelIds).toContain('voyage-code-3')
expect(modelIds).toContain('voyage-finance-2')
expect(modelIds).toContain('voyage-law-2')
})

it('should have both rerank models in the dropdown', () => {
it('should have all rerank models in the dropdown', () => {
const modelBlock = VoyageAIBlock.subBlocks.find((sb) => sb.id === 'rerankModel') as any
expect(modelBlock).toBeDefined()
const modelIds = modelBlock.options.map((o: any) => o.id)
expect(modelIds).toContain('rerank-2.5')
expect(modelIds).toContain('rerank-2.5-lite')
expect(modelIds).toContain('rerank-2')
expect(modelIds).toContain('rerank-2-lite')
})
Expand Down
13 changes: 9 additions & 4 deletions apps/sim/blocks/blocks/voyageai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,18 @@ export const VoyageAIBlock: BlockConfig = {
title: 'Model',
type: 'dropdown',
options: [
{ label: 'voyage-4-large', id: 'voyage-4-large' },
{ label: 'voyage-4', id: 'voyage-4' },
{ label: 'voyage-4-lite', id: 'voyage-4-lite' },
{ label: 'voyage-3.5', id: 'voyage-3.5' },
{ label: 'voyage-3.5-lite', id: 'voyage-3.5-lite' },
{ label: 'voyage-3-large', id: 'voyage-3-large' },
{ label: 'voyage-3', id: 'voyage-3' },
{ label: 'voyage-3-lite', id: 'voyage-3-lite' },
{ label: 'voyage-code-3', id: 'voyage-code-3' },
{ label: 'voyage-finance-2', id: 'voyage-finance-2' },
{ label: 'voyage-law-2', id: 'voyage-law-2' },
],
condition: { field: 'operation', value: 'embeddings' },
value: () => 'voyage-3',
value: () => 'voyage-3.5',
},
{
id: 'inputType',
Expand Down Expand Up @@ -81,11 +84,13 @@ export const VoyageAIBlock: BlockConfig = {
title: 'Model',
type: 'dropdown',
options: [
{ label: 'rerank-2.5', id: 'rerank-2.5' },
{ label: 'rerank-2.5-lite', id: 'rerank-2.5-lite' },
{ label: 'rerank-2', id: 'rerank-2' },
{ label: 'rerank-2-lite', id: 'rerank-2-lite' },
],
condition: { field: 'operation', value: 'rerank' },
value: () => 'rerank-2',
value: () => 'rerank-2.5',
},
{
id: 'topK',
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/tools/voyageai/embeddings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const embeddingsTool: ToolConfig<VoyageAIEmbeddingsParams, VoyageAIEmbedd
required: false,
visibility: 'user-only',
description: 'Embedding model to use',
default: 'voyage-3',
default: 'voyage-3.5',
},
inputType: {
type: 'string',
Expand All @@ -45,7 +45,7 @@ export const embeddingsTool: ToolConfig<VoyageAIEmbeddingsParams, VoyageAIEmbedd
body: (params) => {
const body: Record<string, unknown> = {
input: Array.isArray(params.input) ? params.input : [params.input],
model: params.model || 'voyage-3',
model: params.model || 'voyage-3.5',
}
if (params.inputType) {
body.input_type = params.inputType
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/tools/voyageai/rerank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const rerankTool: ToolConfig<VoyageAIRerankParams, VoyageAIRerankResponse
required: false,
visibility: 'user-only',
description: 'Reranking model to use',
default: 'rerank-2',
default: 'rerank-2.5',
},
topK: {
type: 'number',
Expand Down Expand Up @@ -55,7 +55,7 @@ export const rerankTool: ToolConfig<VoyageAIRerankParams, VoyageAIRerankResponse
const body: Record<string, unknown> = {
query: params.query,
documents,
model: params.model || 'rerank-2',
model: params.model || 'rerank-2.5',
}
if (params.topK) {
body.top_k = params.topK
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/tools/voyageai/voyageai.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describeIntegration('VoyageAI Integration Tests (live API)', () => {
expect(result.success).toBe(true)
expect(result.output.embeddings).toHaveLength(1)
expect(result.output.embeddings[0].length).toBeGreaterThan(100)
expect(result.output.model).toBe('voyage-3')
expect(result.output.model).toBe('voyage-3.5')
expect(result.output.usage.total_tokens).toBeGreaterThan(0)
}, 15000)

Expand Down Expand Up @@ -246,7 +246,7 @@ describeIntegration('VoyageAI Integration Tests (live API)', () => {

expect(result.success).toBe(true)
expect(result.output.results).toHaveLength(3)
expect(result.output.model).toBe('rerank-2')
expect(result.output.model).toBe('rerank-2.5')
expect(result.output.usage.total_tokens).toBeGreaterThan(0)

for (const r of result.output.results) {
Expand Down
8 changes: 4 additions & 4 deletions apps/sim/tools/voyageai/voyageai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Voyage AI Embeddings Tool', () => {
expect(embeddingsTool.params.apiKey.required).toBe(true)
expect(embeddingsTool.params.model).toBeDefined()
expect(embeddingsTool.params.model.required).toBe(false)
expect(embeddingsTool.params.model.default).toBe('voyage-3')
expect(embeddingsTool.params.model.default).toBe('voyage-3.5')
expect(embeddingsTool.params.inputType).toBeDefined()
expect(embeddingsTool.params.inputType.required).toBe(false)
})
Expand Down Expand Up @@ -115,7 +115,7 @@ describe('Voyage AI Embeddings Tool', () => {

it('should use default model voyage-3 when not specified', () => {
const body = tester.getRequestBody({ apiKey: 'key', input: 'hello' })
expect(body.model).toBe('voyage-3')
expect(body.model).toBe('voyage-3.5')
})

it('should use specified model voyage-3-large', () => {
Expand Down Expand Up @@ -298,7 +298,7 @@ describe('Voyage AI Rerank Tool', () => {
expect(rerankTool.params.apiKey.required).toBe(true)
expect(rerankTool.params.model).toBeDefined()
expect(rerankTool.params.model.required).toBe(false)
expect(rerankTool.params.model.default).toBe('rerank-2')
expect(rerankTool.params.model.default).toBe('rerank-2.5')
expect(rerankTool.params.topK).toBeDefined()
expect(rerankTool.params.topK.required).toBe(false)
})
Expand Down Expand Up @@ -340,7 +340,7 @@ describe('Voyage AI Rerank Tool', () => {
})
expect(body.query).toBe('what is AI?')
expect(body.documents).toEqual(['AI is...', 'Machine learning is...'])
expect(body.model).toBe('rerank-2')
expect(body.model).toBe('rerank-2.5')
})

it('should parse JSON string documents into array', () => {
Expand Down