chore: update version to 0.0.26 in package.json; make baseUrl and timeout optional in JimengOptions
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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>> {
|
||||
|
||||
Reference in New Issue
Block a user