Merge branch 'main' of 47.107.44.202:xionglijia/18xchat
# Conflicts: # assets/Scripts/chat18x/core/ChatAIService.ts # assets/Scripts/chat18x/utils/ErrorHandler.ts # xchat_cfg
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import { DataId, DataManager } from "../data/DataManager";
|
||||
import { GlobalData } from "../data/GlobalData";
|
||||
import { ConfigManager } from "../manager/ConfigManager";
|
||||
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
||||
|
||||
export interface AIConfig {
|
||||
/** API密钥 */
|
||||
@@ -62,7 +63,7 @@ export class ApiConfig {
|
||||
).getTimeout(), // 30秒
|
||||
};
|
||||
|
||||
//console.warn(this.config.apiKey);
|
||||
//logger.warn(this.config.apiKey);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,7 +100,7 @@ export class ApiConfig {
|
||||
if (temperature >= 0 && temperature <= 2) {
|
||||
this.config.temperature = temperature;
|
||||
} else {
|
||||
console.warn("Temperature should be between 0 and 2");
|
||||
logger.warn("Temperature should be between 0 and 2");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,11 +116,11 @@ export class ApiConfig {
|
||||
*/
|
||||
public validateConfig(): boolean {
|
||||
if (!this.config.apiKey || this.config.apiKey.trim() === "") {
|
||||
console.error("API key is missing");
|
||||
logger.error("API key is missing");
|
||||
return false;
|
||||
}
|
||||
if (!this.config.model || this.config.model.trim() === "") {
|
||||
console.error("Model name is missing");
|
||||
logger.error("Model name is missing");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user