@kevisual/ai 0.0.25 → 0.0.26
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/package.json +1 -1
- package/src/jimeng/core.ts +3 -3
package/package.json
CHANGED
package/src/jimeng/core.ts
CHANGED
|
@@ -3,9 +3,9 @@ export interface JimengOptions {
|
|
|
3
3
|
/** API密钥,用于认证请求 */
|
|
4
4
|
apiKey: string;
|
|
5
5
|
/** API基础URL */
|
|
6
|
-
baseUrl
|
|
6
|
+
baseUrl?: string;
|
|
7
7
|
/** 请求超时时间(毫秒) */
|
|
8
|
-
timeout
|
|
8
|
+
timeout?: number;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface JimengGenerateOptions {
|
|
@@ -37,7 +37,7 @@ export class JimengService {
|
|
|
37
37
|
constructor(options: JimengOptions) {
|
|
38
38
|
this.apiKey = options.apiKey;
|
|
39
39
|
this.baseUrl = options.baseUrl || 'https://jimeng-api.kevisual.cn/v1';
|
|
40
|
-
this.timeout = options.timeout;
|
|
40
|
+
this.timeout = options.timeout || 10 * 60 * 1000; // 默认10分钟
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
async generateImage(options: JimengGenerateOptions): Promise<Result<JimengResponse>> {
|