@@ -6,12 +6,12 @@ import {
6
6
assertLessOrEqual ,
7
7
assertStringIncludes ,
8
8
assertThrows ,
9
- } from ' jsr:@std/assert' ;
9
+ } from " jsr:@std/assert" ;
10
10
11
- const session = new Supabase . ai . Session ( ' gte-small' ) ;
11
+ const session = new Supabase . ai . Session ( " gte-small" ) ;
12
12
13
13
assertThrows ( ( ) => {
14
- const _ = new Supabase . ai . Session ( ' gte-small_wrong_name' ) ;
14
+ const _ = new Supabase . ai . Session ( " gte-small_wrong_name" ) ;
15
15
} , "invalid 'Session' type" ) ;
16
16
17
17
function dotProduct ( a : number [ ] , b : number [ ] ) {
@@ -27,14 +27,13 @@ export default {
27
27
async fetch ( ) {
28
28
// Generate embedding
29
29
// @ts -ignore unkwnow type
30
- const [ meow , meowError ] = await session . run ( ' meow' ) as [
30
+ const [ meow , meowError ] = await session . run ( " meow" ) as [
31
31
number [ ] ,
32
32
undefined ,
33
33
] ;
34
- console . log ( 'cat' , meow , meowError ) ;
35
34
36
35
// @ts -ignore unkwnow type
37
- const [ love , loveError ] = await session . run ( ' I love cats' , {
36
+ const [ love , loveError ] = await session . run ( " I love cats" , {
38
37
mean_pool : true ,
39
38
normalize : true ,
40
39
} ) as [ number [ ] , undefined ] ;
@@ -51,7 +50,7 @@ export default {
51
50
// "Invalid input should result in error value"
52
51
{
53
52
const [ notCat , notCatError ] = await session . run ( {
54
- bad_input : { ' not a cat' : ' let fail' } ,
53
+ bad_input : { " not a cat" : " let fail" } ,
55
54
} ) as [ undefined , { message : string ; inner : Error } ] ;
56
55
57
56
assertEquals ( notCat , undefined ) ;
@@ -60,7 +59,7 @@ export default {
60
59
assertIsError ( notCatError . inner ) ;
61
60
assertStringIncludes (
62
61
notCatError . message ,
63
- ' must provide a valid prompt value' ,
62
+ " must provide a valid prompt value" ,
64
63
) ;
65
64
}
66
65
0 commit comments