Skip to content

Commit 1bf99c0

Browse files
committed
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
1 parent 0db15ec commit 1bf99c0

File tree

6 files changed

+29
-19
lines changed

6 files changed

+29
-19
lines changed

apps/sim/blocks/blocks/voyageai.test.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('VoyageAIBlock', () => {
7373

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

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

147-
it('should have all 6 embedding models in the dropdown', () => {
147+
it('should have all embedding models in the dropdown', () => {
148148
const modelBlock = VoyageAIBlock.subBlocks.find((sb) => sb.id === 'embeddingModel') as any
149149
expect(modelBlock).toBeDefined()
150150
const modelIds = modelBlock.options.map((o: any) => o.id)
151+
expect(modelIds).toContain('voyage-4-large')
152+
expect(modelIds).toContain('voyage-4')
153+
expect(modelIds).toContain('voyage-4-lite')
154+
expect(modelIds).toContain('voyage-3.5')
155+
expect(modelIds).toContain('voyage-3.5-lite')
151156
expect(modelIds).toContain('voyage-3-large')
152-
expect(modelIds).toContain('voyage-3')
153-
expect(modelIds).toContain('voyage-3-lite')
154157
expect(modelIds).toContain('voyage-code-3')
155158
expect(modelIds).toContain('voyage-finance-2')
156159
expect(modelIds).toContain('voyage-law-2')
157160
})
158161

159-
it('should have both rerank models in the dropdown', () => {
162+
it('should have all rerank models in the dropdown', () => {
160163
const modelBlock = VoyageAIBlock.subBlocks.find((sb) => sb.id === 'rerankModel') as any
161164
expect(modelBlock).toBeDefined()
162165
const modelIds = modelBlock.options.map((o: any) => o.id)
166+
expect(modelIds).toContain('rerank-2.5')
167+
expect(modelIds).toContain('rerank-2.5-lite')
163168
expect(modelIds).toContain('rerank-2')
164169
expect(modelIds).toContain('rerank-2-lite')
165170
})

apps/sim/blocks/blocks/voyageai.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,18 @@ export const VoyageAIBlock: BlockConfig = {
3838
title: 'Model',
3939
type: 'dropdown',
4040
options: [
41+
{ label: 'voyage-4-large', id: 'voyage-4-large' },
42+
{ label: 'voyage-4', id: 'voyage-4' },
43+
{ label: 'voyage-4-lite', id: 'voyage-4-lite' },
44+
{ label: 'voyage-3.5', id: 'voyage-3.5' },
45+
{ label: 'voyage-3.5-lite', id: 'voyage-3.5-lite' },
4146
{ label: 'voyage-3-large', id: 'voyage-3-large' },
42-
{ label: 'voyage-3', id: 'voyage-3' },
43-
{ label: 'voyage-3-lite', id: 'voyage-3-lite' },
4447
{ label: 'voyage-code-3', id: 'voyage-code-3' },
4548
{ label: 'voyage-finance-2', id: 'voyage-finance-2' },
4649
{ label: 'voyage-law-2', id: 'voyage-law-2' },
4750
],
4851
condition: { field: 'operation', value: 'embeddings' },
49-
value: () => 'voyage-3',
52+
value: () => 'voyage-3.5',
5053
},
5154
{
5255
id: 'inputType',
@@ -81,11 +84,13 @@ export const VoyageAIBlock: BlockConfig = {
8184
title: 'Model',
8285
type: 'dropdown',
8386
options: [
87+
{ label: 'rerank-2.5', id: 'rerank-2.5' },
88+
{ label: 'rerank-2.5-lite', id: 'rerank-2.5-lite' },
8489
{ label: 'rerank-2', id: 'rerank-2' },
8590
{ label: 'rerank-2-lite', id: 'rerank-2-lite' },
8691
],
8792
condition: { field: 'operation', value: 'rerank' },
88-
value: () => 'rerank-2',
93+
value: () => 'rerank-2.5',
8994
},
9095
{
9196
id: 'topK',

apps/sim/tools/voyageai/embeddings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const embeddingsTool: ToolConfig<VoyageAIEmbeddingsParams, VoyageAIEmbedd
1919
required: false,
2020
visibility: 'user-only',
2121
description: 'Embedding model to use',
22-
default: 'voyage-3',
22+
default: 'voyage-3.5',
2323
},
2424
inputType: {
2525
type: 'string',
@@ -45,7 +45,7 @@ export const embeddingsTool: ToolConfig<VoyageAIEmbeddingsParams, VoyageAIEmbedd
4545
body: (params) => {
4646
const body: Record<string, unknown> = {
4747
input: Array.isArray(params.input) ? params.input : [params.input],
48-
model: params.model || 'voyage-3',
48+
model: params.model || 'voyage-3.5',
4949
}
5050
if (params.inputType) {
5151
body.input_type = params.inputType

apps/sim/tools/voyageai/rerank.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const rerankTool: ToolConfig<VoyageAIRerankParams, VoyageAIRerankResponse
2525
required: false,
2626
visibility: 'user-only',
2727
description: 'Reranking model to use',
28-
default: 'rerank-2',
28+
default: 'rerank-2.5',
2929
},
3030
topK: {
3131
type: 'number',
@@ -55,7 +55,7 @@ export const rerankTool: ToolConfig<VoyageAIRerankParams, VoyageAIRerankResponse
5555
const body: Record<string, unknown> = {
5656
query: params.query,
5757
documents,
58-
model: params.model || 'rerank-2',
58+
model: params.model || 'rerank-2.5',
5959
}
6060
if (params.topK) {
6161
body.top_k = params.topK

apps/sim/tools/voyageai/voyageai.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describeIntegration('VoyageAI Integration Tests (live API)', () => {
5555
expect(result.success).toBe(true)
5656
expect(result.output.embeddings).toHaveLength(1)
5757
expect(result.output.embeddings[0].length).toBeGreaterThan(100)
58-
expect(result.output.model).toBe('voyage-3')
58+
expect(result.output.model).toBe('voyage-3.5')
5959
expect(result.output.usage.total_tokens).toBeGreaterThan(0)
6060
}, 15000)
6161

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

247247
expect(result.success).toBe(true)
248248
expect(result.output.results).toHaveLength(3)
249-
expect(result.output.model).toBe('rerank-2')
249+
expect(result.output.model).toBe('rerank-2.5')
250250
expect(result.output.usage.total_tokens).toBeGreaterThan(0)
251251

252252
for (const r of result.output.results) {

apps/sim/tools/voyageai/voyageai.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('Voyage AI Embeddings Tool', () => {
3232
expect(embeddingsTool.params.apiKey.required).toBe(true)
3333
expect(embeddingsTool.params.model).toBeDefined()
3434
expect(embeddingsTool.params.model.required).toBe(false)
35-
expect(embeddingsTool.params.model.default).toBe('voyage-3')
35+
expect(embeddingsTool.params.model.default).toBe('voyage-3.5')
3636
expect(embeddingsTool.params.inputType).toBeDefined()
3737
expect(embeddingsTool.params.inputType.required).toBe(false)
3838
})
@@ -115,7 +115,7 @@ describe('Voyage AI Embeddings Tool', () => {
115115

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

121121
it('should use specified model voyage-3-large', () => {
@@ -298,7 +298,7 @@ describe('Voyage AI Rerank Tool', () => {
298298
expect(rerankTool.params.apiKey.required).toBe(true)
299299
expect(rerankTool.params.model).toBeDefined()
300300
expect(rerankTool.params.model.required).toBe(false)
301-
expect(rerankTool.params.model.default).toBe('rerank-2')
301+
expect(rerankTool.params.model.default).toBe('rerank-2.5')
302302
expect(rerankTool.params.topK).toBeDefined()
303303
expect(rerankTool.params.topK.required).toBe(false)
304304
})
@@ -340,7 +340,7 @@ describe('Voyage AI Rerank Tool', () => {
340340
})
341341
expect(body.query).toBe('what is AI?')
342342
expect(body.documents).toEqual(['AI is...', 'Machine learning is...'])
343-
expect(body.model).toBe('rerank-2')
343+
expect(body.model).toBe('rerank-2.5')
344344
})
345345

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

0 commit comments

Comments
 (0)