-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Pi: Fix Pinecone vector-search output options. The Pinecone block expose... #6064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -514,6 +514,15 @@ export const PineconeBlock: BlockConfig<PineconeResponse> = { | |
| if (params.deleteAll != null && params.deleteAll !== '') { | ||
| result.deleteAll = params.deleteAll === true || params.deleteAll === 'true' | ||
| } | ||
| if (params.options != null && params.options !== '') { | ||
| const options = Array.isArray(params.options) | ||
| ? params.options | ||
| : typeof params.options === 'string' | ||
| ? JSON.parse(params.options) | ||
| : [] | ||
| result.includeValues = options.includes('includeValues') | ||
| result.includeMetadata = options.includes('includeMetadata') | ||
| } | ||
|
Comment on lines
+517
to
+525
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When a user enables Include Values and/or Include Metadata on a Pinecone Knowledge Base Used: Blocks Module |
||
| return result | ||
| }, | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /** | ||
| * @vitest-environment node | ||
| */ | ||
| import { describe, expect, it } from 'vitest' | ||
| import { searchVectorTool } from '@/tools/pinecone/search_vector' | ||
|
|
||
| const baseParams = { | ||
| apiKey: 'test-key', | ||
| indexHost: 'https://example.pinecone.io', | ||
| vector: [0.1, 0.2], | ||
| } | ||
|
|
||
| describe('Pinecone vector search output options', () => { | ||
| it.each([ | ||
| [{}, false, false], | ||
| [{ includeValues: true }, true, false], | ||
| [{ includeMetadata: true }, false, true], | ||
| [{ includeValues: true, includeMetadata: true }, true, true], | ||
| ])('sends the selected options (%j)', (options, includeValues, includeMetadata) => { | ||
| const body = searchVectorTool.request.body?.({ ...baseParams, ...options }) | ||
|
|
||
| expect(body).toMatchObject({ includeValues, includeMetadata }) | ||
| }) | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checkbox options never reach query
High Severity
The new mapper reads
params.optionsas an array of selected IDs, butcheckbox-liststores each choice as a boolean under the option id (includeValues/includeMetadata), and those keys are dropped during block param extraction. UI selections never set the tool flags, so search always sends both asfalseafter the hardcodedtruedefaults were removed.Additional Locations (1)
apps/sim/tools/pinecone/search_vector.ts#L78-L80Reviewed by Cursor Bugbot for commit fd9e9b7. Configure here.