This repository was archived by the owner on Oct 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +1
-9
lines changed
examples/collection/assembly Expand file tree Collapse file tree 2 files changed +1
-9
lines changed Original file line number Diff line number Diff line change 6
6
- Add namespace support for collections [ #158 ] ( https://github.com/hypermodeAI/functions-as/pull/158 )
7
7
- Add getNamespaces host function to collections [ #160 ] ( https://github.com/hypermodeAI/functions-as/pull/160 )
8
8
- Add cross namespace search support to collections [ #161 ] ( https://github.com/hypermodeAI/functions-as/pull/161 )
9
+ - Update collections example [ #162 ] ( https://github.com/hypermodeAI/functions-as/pull/162 )
9
10
10
11
## 2024-08-01 - Version 0.10.5
11
12
Original file line number Diff line number Diff line change @@ -17,25 +17,16 @@ export function embed(text: string[]): f32[][] {
17
17
18
18
export function addProduct ( description : string ) : string [ ] {
19
19
const response = collections . upsert ( myProducts , null , description ) ;
20
- if ( ! response . isSuccessful ) {
21
- throw new Error ( response . error ) ;
22
- }
23
20
return response . keys ;
24
21
}
25
22
26
23
export function addProducts ( descriptions : string [ ] ) : string [ ] {
27
24
const response = collections . upsertBatch ( myProducts , [ ] , descriptions ) ;
28
- if ( ! response . isSuccessful ) {
29
- throw new Error ( response . error ) ;
30
- }
31
25
return response . keys ;
32
26
}
33
27
34
28
export function deleteProduct ( key : string ) : string {
35
29
const response = collections . remove ( myProducts , key ) ;
36
- if ( ! response . isSuccessful ) {
37
- throw new Error ( response . error ) ;
38
- }
39
30
return response . status ;
40
31
}
41
32
You can’t perform that action at this time.
0 commit comments