diff --git a/package.json b/package.json index 073b9ab..f4d7d57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/ai", - "version": "0.0.25", + "version": "0.0.26", "description": "AI Center Services", "main": "index.js", "basename": "/root/ai-center-services", diff --git a/src/jimeng/core.ts b/src/jimeng/core.ts index 6f6c18a..dc525df 100644 --- a/src/jimeng/core.ts +++ b/src/jimeng/core.ts @@ -3,9 +3,9 @@ export interface JimengOptions { /** API密钥,用于认证请求 */ apiKey: string; /** API基础URL */ - baseUrl: string; + baseUrl?: string; /** 请求超时时间(毫秒) */ - timeout: number; + timeout?: number; } export interface JimengGenerateOptions { @@ -37,7 +37,7 @@ export class JimengService { constructor(options: JimengOptions) { this.apiKey = options.apiKey; this.baseUrl = options.baseUrl || 'https://jimeng-api.kevisual.cn/v1'; - this.timeout = options.timeout; + this.timeout = options.timeout || 10 * 60 * 1000; // 默认10分钟 } async generateImage(options: JimengGenerateOptions): Promise> {