Skip to content

Commit 133e75f

Browse files
author
aadamgough
committed
pinecone fix
1 parent d8e6f8e commit 133e75f

File tree

4 files changed

+6
-21
lines changed

4 files changed

+6
-21
lines changed

apps/sim/blocks/blocks/pinecone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export const PineconeBlock: BlockConfig<PineconeResponse> = {
264264

265265
outputs: {
266266
matches: { type: 'json', description: 'Search matches' },
267-
upsertedCount: { type: 'number', description: 'Upserted count' },
267+
statusText: { type: 'string', description: 'Status of the upsert operation' },
268268
data: { type: 'json', description: 'Response data' },
269269
model: { type: 'string', description: 'Model information' },
270270
vector_type: { type: 'string', description: 'Vector type' },

apps/sim/tools/__test-utils__/mock-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export const mockPineconeResponses = {
168168

169169
// Upsert response
170170
upsertResponse: {
171-
upsertedCount: 5,
171+
statusText: 'Created',
172172
},
173173
}
174174

apps/sim/tools/pinecone/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface PineconeMatchResponse {
1818
export interface PineconeResponse extends ToolResponse {
1919
output: {
2020
matches?: PineconeMatchResponse[]
21-
upsertedCount?: number
21+
statusText?: string
2222
data?: Array<{
2323
values: number[]
2424
vector_type: 'dense' | 'sparse'

apps/sim/tools/pinecone/upsert_text.ts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,11 @@ export const upsertTextTool: ToolConfig<PineconeUpsertTextParams, PineconeRespon
7171
},
7272

7373
transformResponse: async (response) => {
74-
// Handle empty response (201 Created)
75-
if (response.status === 201) {
76-
return {
77-
success: true,
78-
output: {
79-
statusText: 'Created',
80-
},
81-
}
82-
}
83-
84-
// Handle response with content
85-
const data = await response.json()
74+
// Pinecone upsert returns 201 Created with empty body on success
8675
return {
87-
success: true,
76+
success: response.status === 201,
8877
output: {
89-
upsertedCount: data.upsertedCount || 0,
78+
statusText: response.status === 201 ? 'Created' : response.statusText,
9079
},
9180
}
9281
},
@@ -96,9 +85,5 @@ export const upsertTextTool: ToolConfig<PineconeUpsertTextParams, PineconeRespon
9685
type: 'string',
9786
description: 'Status of the upsert operation',
9887
},
99-
upsertedCount: {
100-
type: 'number',
101-
description: 'Number of records successfully upserted',
102-
},
10388
},
10489
}

0 commit comments

Comments
 (0)