There was an error while loading. Please reload this page.
1 parent 6f4c3b5 commit 0a1baf2Copy full SHA for 0a1baf2
1 file changed
pinecone-assistant/actions/search.ts
@@ -15,12 +15,18 @@ export interface Props {
15
* @description The number of context snippets to retrieve. Defaults to 15.
16
*/
17
topK?: number;
18
+
19
+ /**
20
+ * @description Whether to include metadata in the response. Defaults to false.
21
+ */
22
+ includeMetadata?: boolean;
23
}
24
25
interface QueryResult {
26
content: {
27
type: string;
28
text: string;
29
+ metadata?: Record<string, string>;
30
}[];
31
32
@@ -58,6 +64,9 @@ const action = async (
58
64
return {
59
65
type: "text",
60
66
text,
67
+ metadata: props.includeMetadata
68
+ ? snippet.reference.file.metadata ?? {}
69
+ : undefined,
61
70
};
62
71
}),
63
72
0 commit comments