MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getCurrentProviderConfig

Method getCurrentProviderConfig

ai/ai.ts:2546–2575  ·  view source on GitHub ↗
(
    type: "chat" | "search" | "image" | "video",
  )

Source from the content-addressed store, hash-verified

2544
2545 private async getCurrentProviderConfig(
2546 type: "chat" | "search" | "image" | "video",
2547 ): Promise<{ providerConfig: ProviderConfig; model: string; config: DB }> {
2548 const configManager = await this.getConfigManager();
2549 const config = configManager.getConfig();
2550
2551 const tag =
2552 type === "chat"
2553 ? config.currentChatTag
2554 : type === "search"
2555 ? config.currentSearchTag
2556 : type === "image"
2557 ? config.currentImageTag
2558 : config.currentVideoTag;
2559
2560 const model =
2561 type === "chat"
2562 ? config.currentChatModel
2563 : type === "search"
2564 ? config.currentSearchModel
2565 : type === "image"
2566 ? config.currentImageModel
2567 : config.currentVideoModel;
2568
2569 if (!tag || !model || !config.configs[tag]) {
2570 throw new UserError("请先配置 API 并设置模型");
2571 }
2572
2573 return { providerConfig: config.configs[tag], model, config };
2574 }
2575
2576 private resolveMode(
2577 providerConfig: ProviderConfig,
2578 mode: ProviderMode,

Callers 5

callAIMethod · 0.95
callSearchMethod · 0.95
generateImageMethod · 0.95
editImageMethod · 0.95
generateVideoMethod · 0.95

Calls 2

getConfigManagerMethod · 0.95
getConfigMethod · 0.45

Tested by

no test coverage detected