sst 3.0.1-36 → 3.0.1-37
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.
- package/dist/vector-client.d.ts +4 -1
- package/dist/vector-client.js +2 -2
- package/package.json +1 -1
package/dist/vector-client.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Resource } from "./resource.js";
|
|
1
2
|
export type IngestEvent = {
|
|
2
3
|
/**
|
|
3
4
|
* The text used to generate the embedding vector.
|
|
@@ -175,7 +176,9 @@ type RetriveResponse = {
|
|
|
175
176
|
*/
|
|
176
177
|
score: number;
|
|
177
178
|
};
|
|
178
|
-
export declare
|
|
179
|
+
export declare function VectorClient<T extends keyof {
|
|
180
|
+
[key in keyof Resource as "sst.aws.Vector" extends Resource[key]["type"] ? string extends key ? never : key : never]: Resource[key];
|
|
181
|
+
}>(name: T): {
|
|
179
182
|
ingest: (event: IngestEvent) => Promise<void>;
|
|
180
183
|
retrieve: (event: RetrieveEvent) => Promise<RetriveResponse>;
|
|
181
184
|
remove: (event: RemoveEvent) => Promise<void>;
|
package/dist/vector-client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LambdaClient, InvokeCommand, } from "@aws-sdk/client-lambda";
|
|
2
2
|
import { Resource } from "./resource.js";
|
|
3
3
|
const lambda = new LambdaClient();
|
|
4
|
-
export
|
|
4
|
+
export function VectorClient(name) {
|
|
5
5
|
return {
|
|
6
6
|
ingest: async (event) => {
|
|
7
7
|
const ret = await lambda.send(new InvokeCommand({
|
|
@@ -25,7 +25,7 @@ export const VectorClient = (name) => {
|
|
|
25
25
|
parsePayload(ret, "Failed to remove from the vector db");
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
|
-
}
|
|
28
|
+
}
|
|
29
29
|
function parsePayload(output, message) {
|
|
30
30
|
const payload = JSON.parse(Buffer.from(output.Payload).toString());
|
|
31
31
|
// Set cause to the payload so that it can be logged in CloudWatch
|