feat: Optimize the code

This commit is contained in:
pomelo-nwu
2025-10-27 11:01:48 +08:00
parent f9f6eb52dd
commit b1ece177b7
10 changed files with 296 additions and 282 deletions

View File

@@ -908,29 +908,8 @@ export class Config {
return this.tavilyApiKey;
}
getWebSearchConfig():
| {
provider: Array<{
type: 'tavily' | 'google' | 'dashscope';
config: Record<string, unknown>;
}>;
default: string;
}
| undefined {
if (!this.webSearch) {
return undefined;
}
return {
provider: this.webSearch.provider.map((p) => ({
type: p.type,
config: {
apiKey: p.apiKey,
searchEngineId: p.searchEngineId,
},
})),
default: this.webSearch.default,
};
getWebSearchConfig() {
return this.webSearch;
}
getIdeMode(): boolean {