Skip to content

Fix Voyage AI rerank response parsing#6543

Open
vicksiyi wants to merge 2 commits into
FlowiseAI:mainfrom
vicksiyi:codex/fix-voyage-rerank-response
Open

Fix Voyage AI rerank response parsing#6543
vicksiyi wants to merge 2 commits into
FlowiseAI:mainfrom
vicksiyi:codex/fix-voyage-rerank-response

Conversation

@vicksiyi

@vicksiyi vicksiyi commented Jun 22, 2026

Copy link
Copy Markdown

Summary

  • Parse the current Voyage AI rerank REST response shape from data.
  • Preserve compatibility with the previous results response shape.
  • Send the configured result limit as top_k and add regression coverage for both response shapes.

Fixes #6492

Tests

  • pnpm --filter flowise-components exec jest nodes/retrievers/VoyageAIRetriever/VoyageAIRerank.test.ts --runInBand
  • pnpm --filter flowise-components exec eslint nodes/retrievers/VoyageAIRetriever/VoyageAIRerank.ts nodes/retrievers/VoyageAIRetriever/VoyageAIRerank.test.ts --ext ts --max-warnings 0
  • pnpm --filter flowise-components exec tsc --noEmit --pretty false

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the VoyageAIRerank class to include top_k in the API request payload, support both the new data and legacy results response formats from the Voyage API, and use slice instead of splice to return the final results. Additionally, a new test suite has been added to verify these behaviors. The review feedback recommends adding defensive checks to safely parse the API response, including verifying that the results format is an array and ensuring that the documents exist at the returned indices before modifying their metadata.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/components/nodes/retrievers/VoyageAIRetriever/VoyageAIRerank.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Voyage AI Rerank Retriever can't process API responses

1 participant