Skip to content

Commit 5af445a

Browse files
committed
fix: use Supabase namespace for non-std Supabase APIs
1 parent 26a23e0 commit 5af445a

File tree

1 file changed

+35
-33
lines changed

1 file changed

+35
-33
lines changed

src/edge-runtime.d.ts

+35-33
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,47 @@
1-
interface ModelOptions {
2-
/**
3-
* Pool embeddings by taking their mean. Applies only for `gte-small` model
4-
*/
5-
mean_pool?: boolean
1+
declare namespace Supabase {
2+
export interface ModelOptions {
3+
/**
4+
* Pool embeddings by taking their mean. Applies only for `gte-small` model
5+
*/
6+
mean_pool?: boolean
67

7-
/**
8-
* Normalize the embeddings result. Applies only for `gte-small` model
9-
*/
10-
normalize?: boolean
8+
/**
9+
* Normalize the embeddings result. Applies only for `gte-small` model
10+
*/
11+
normalize?: boolean
1112

12-
/**
13-
* Stream response from model. Applies only for LLMs like `mistral` (default: false)
14-
*/
15-
stream?: boolean
13+
/**
14+
* Stream response from model. Applies only for LLMs like `mistral` (default: false)
15+
*/
16+
stream?: boolean
1617

17-
/**
18-
* Automatically abort the request to the model after specified time (in seconds). Applies only for LLMs like `mistral` (default: 60)
19-
*/
20-
timeout?: number
21-
}
18+
/**
19+
* Automatically abort the request to the model after specified time (in seconds). Applies only for LLMs like `mistral` (default: 60)
20+
*/
21+
timeout?: number
22+
}
2223

23-
interface Session {
24-
/**
25-
* Execute the given prompt in model session
26-
*/
27-
run(prompt: string, modelOptions?: ModelOptions): unknown
28-
}
24+
export class Session {
25+
/**
26+
* Create a new model session using given model
27+
*/
28+
constructor(model: string, sessionOptions?: unknown)
2929

30-
declare var Session: {
31-
prototype: Session
32-
/**
33-
* Create a new model session using given model
34-
*/
35-
new (model: string, sessionOptions?: unknown): Session
36-
}
30+
/**
31+
* Execute the given prompt in model session
32+
*/
33+
run(prompt: string, modelOptions?: ModelOptions): unknown
34+
}
3735

38-
declare var Supabase: {
3936
/**
4037
* Provides AI related APIs
4138
*/
42-
readonly ai: {
39+
export interface Ai {
4340
readonly Session: typeof Session
4441
}
42+
43+
/**
44+
* Provides AI related APIs
45+
*/
46+
export const ai: Ai
4547
}

0 commit comments

Comments
 (0)