(
question: string,
images: AIContentPart[] = [],
token?: AbortToken,
)
| 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"); |
no test coverage detected