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

@@ -1,6 +1,6 @@
{ {
"name": "@kevisual/ai", "name": "@kevisual/ai",
"version": "0.0.25", "version": "0.0.26",
"description": "AI Center Services", "description": "AI Center Services",
"main": "index.js", "main": "index.js",
"basename": "/root/ai-center-services", "basename": "/root/ai-center-services",

View File

@@ -3,9 +3,9 @@ export interface JimengOptions {
/** API密钥用于认证请求 */ /** API密钥用于认证请求 */
apiKey: string; apiKey: string;
/** API基础URL */ /** API基础URL */
baseUrl: string; baseUrl?: string;
/** 请求超时时间(毫秒) */ /** 请求超时时间(毫秒) */
timeout: number; timeout?: number;
} }
export interface JimengGenerateOptions { export interface JimengGenerateOptions {
@@ -37,7 +37,7 @@ export class JimengService {
constructor(options: JimengOptions) { constructor(options: JimengOptions) {
this.apiKey = options.apiKey; this.apiKey = options.apiKey;
this.baseUrl = options.baseUrl || 'https://jimeng-api.kevisual.cn/v1'; 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>> { async generateImage(options: JimengGenerateOptions): Promise<Result<JimengResponse>> {