sst 3.0.1-13 → 3.0.1-16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@ export type IngestEvent = {
35
35
  * }
36
36
  * ```
37
37
  */
38
- metadata: any;
38
+ metadata: Record<string, any>;
39
39
  };
40
40
  export type RetrieveEvent = {
41
41
  /**
@@ -86,7 +86,7 @@ export type RetrieveEvent = {
86
86
  * release: "2001",
87
87
  * }
88
88
  */
89
- include: any;
89
+ include: Record<string, any>;
90
90
  /**
91
91
  * Exclude embeddings with metadata that match the provided fields.
92
92
  * @example
@@ -115,7 +115,7 @@ export type RetrieveEvent = {
115
115
  * release: "2001",
116
116
  * }
117
117
  */
118
- exclude?: any;
118
+ exclude?: Record<string, any>;
119
119
  /**
120
120
  * The threshold of similarity between the prompt and the retrieved embeddings.
121
121
  * Only embeddings with a similarity score higher than the threshold will be returned.
@@ -163,10 +163,21 @@ export type RemoveEvent = {
163
163
  * }
164
164
  * }
165
165
  */
166
- include: any;
166
+ include: Record<string, any>;
167
+ };
168
+ type RetriveResponse = {
169
+ /**
170
+ * Metadata for the event in JSON format that was provided when ingesting the embedding.
171
+ */
172
+ metadata: Record<string, any>;
173
+ /**
174
+ * The similarity score between the prompt and the retrieved embedding.
175
+ */
176
+ score: number;
167
177
  };
168
178
  export declare const VectorClient: (name: string) => {
169
- ingest: (event: IngestEvent) => Promise<any>;
170
- retrieve: (event: RetrieveEvent) => Promise<any>;
171
- remove: (event: RemoveEvent) => Promise<any>;
179
+ ingest: (event: IngestEvent) => Promise<void>;
180
+ retrieve: (event: RetrieveEvent) => Promise<RetriveResponse>;
181
+ remove: (event: RemoveEvent) => Promise<void>;
172
182
  };
183
+ export {};
@@ -8,7 +8,7 @@ export const VectorClient = (name) => {
8
8
  FunctionName: Resource[name].ingestorFunctionName,
9
9
  Payload: JSON.stringify(event),
10
10
  }));
11
- return parsePayload(ret, "Failed to ingest into the vector db");
11
+ parsePayload(ret, "Failed to ingest into the vector db");
12
12
  },
13
13
  retrieve: async (event) => {
14
14
  const ret = await lambda.send(new InvokeCommand({
@@ -22,7 +22,7 @@ export const VectorClient = (name) => {
22
22
  FunctionName: Resource[name].removerFunctionName,
23
23
  Payload: JSON.stringify(event),
24
24
  }));
25
- return parsePayload(ret, "Failed to remove from the vector db");
25
+ parsePayload(ret, "Failed to remove from the vector db");
26
26
  },
27
27
  };
28
28
  };
package/package.json CHANGED
@@ -2,7 +2,8 @@
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "sst",
4
4
  "type": "module",
5
- "version": "3.0.1-13",
5
+ "sideEffects": false,
6
+ "version": "3.0.1-16",
6
7
  "main": "./dist/index.js",
7
8
  "exports": {
8
9
  ".": "./dist/index.js",