fix:【AI 大模型】toolContext 为空,会导致报错问题

This commit is contained in:
YunaiV 2025-05-21 22:56:49 +08:00
parent 73e4f831f2
commit 951663b6b7
1 changed files with 1 additions and 0 deletions

View File

@ -38,6 +38,7 @@ public class AiUtils {
public static ChatOptions buildChatOptions(AiPlatformEnum platform, String model, Double temperature, Integer maxTokens,
Set<String> toolNames, Map<String, Object> toolContext) {
toolNames = ObjUtil.defaultIfNull(toolNames, Collections.emptySet());
toolContext = ObjUtil.defaultIfNull(toolContext, Collections.emptyMap());
// noinspection EnhancedSwitchMigration
switch (platform) {
case TONG_YI: