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

Method callSearch

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

Source from the content-addressed store, hash-verified

3658
3659 async callSearch(
3660 question: string,
3661 images: AIContentPart[] = [],
3662 token?: AbortToken,
3663 ): Promise<{
3664 text: string;
3665 sources: Array<{ url: string; title?: string }>;
3666 }> {
3667 const { providerConfig, model, config } =
3668 await this.getCurrentProviderConfig("search");
3669 const { modeConfig } = this.resolveMode(providerConfig, "search", model);
3670 const handler = this.strategyHandlers[modeConfig.strategy]?.search;
3671 if (!handler) throw new UserError("当前提供商不支持搜索模式");
3672 return await handler({
3673 providerConfig,
3674 model,
3675 config,
3676 modeConfig,
3677 question,
3678 images,
3679 token,
3680 });
3681 }
3682
3683 async generateImage(prompt: string, token?: AbortToken): Promise<AIImage[]> {
3684 const { providerConfig, model, config } =
3685 await this.getCurrentProviderConfig("image");

Callers 1

executeMethod · 0.80

Calls 2

resolveModeMethod · 0.95

Tested by

no test coverage detected