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

Method callAI

ai/ai.ts:3639–3658  ·  view source on GitHub ↗
(
    question: string,
    images: AIContentPart[] = [],
    token?: AbortToken,
  )

Source from the content-addressed store, hash-verified

3637
3638 async callAI(
3639 question: string,
3640 images: AIContentPart[] = [],
3641 token?: AbortToken,
3642 ): Promise<{ text: string; images: AIImage[] }> {
3643 const { providerConfig, model, config } =
3644 await this.getCurrentProviderConfig("chat");
3645 const { modeConfig } = this.resolveMode(providerConfig, "chat", model);
3646 const handler = this.strategyHandlers[modeConfig.strategy]?.chat;
3647 if (!handler) throw new UserError("当前提供商不支持聊天");
3648 return await handler({
3649 providerConfig,
3650 model,
3651 config,
3652 modeConfig,
3653 question,
3654 images,
3655 token,
3656 });
3657 }
3658
3659 async callSearch(
3660 question: string,
3661 images: AIContentPart[] = [],

Callers 1

handleQuestionMethod · 0.80

Calls 2

resolveModeMethod · 0.95

Tested by

no test coverage detected