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",
|
"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",
|
||||||
|
|||||||
@@ -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>> {
|
||||||
|
|||||||
Reference in New Issue
Block a user