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