chore: update version to 0.0.26 in package.json; make baseUrl and timeout optional in JimengOptions

This commit is contained in:
2026-03-03 01:45:41 +08:00
parent 076fcbd55a
commit 419ac31185
2 changed files with 4 additions and 4 deletions

View File

@@ -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<Result<JimengResponse>> {