-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.d.ts
79 lines (62 loc) · 1.46 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
declare module "api2d"
declare class Api2d {
constructor(
key?: null | string,
apiBaseUrl?: null | string,
timeout?: number,
);
setKey(key: string): void;
setApiBaseUrl(apiBaseUrl: string): void;
setTimeout(timeout: number): void;
abort(): void;
completion(options: {
onMessage?: (message: string) => void;
onEnd?: (message: string) => void;
model?: string;
stream?: boolean;
noCache?: boolean;
[key: string]: any;
}): Promise<string> | Object;
embeddings(options: {
model?: string;
[key: string]: any;
}): Promise<any>;
billing(): Promise<any>;
vectorSave(options:{
text: string,
embedding: number[],
uuid?: string,
meta?: string
}
): Promise<any>;
vectorSearch(options:{
searchable_id: string,
embedding: number[], // 1536维的向量
topk?: number
}
): Promise<any>;
vectorDelete(options:{
uuid: string
}): Promise<any>;
vectorDeleteAll(): Promise<any>;
textToSpeech(options: {
text: string;
voiceName: string;
responseType: 'file' | 'stream';
output: string | any;
}): Promise<boolean> | Promise<void>;
speechToText(options: {
file: string;
language: string;
moderation?: boolean;
moderation_stop?: boolean;
}): Promise<string>;
imageGenerate(options: {
model?: string;
prompt?: string;
n?: number;
size?: string;
response_format?: string;
}): Promise<any>;
}
export default Api2d