diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Consts/PremiumPackageConst.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Consts/PremiumPackageConst.cs index d26312c9..0fffa52a 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Consts/PremiumPackageConst.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Consts/PremiumPackageConst.cs @@ -10,6 +10,7 @@ public class PremiumPackageConst "claude-haiku-4-5-20251001", "claude-opus-4-5-20251101", "gemini-3-pro-preview", - "gpt-5.1-codex-max" + "gpt-5.1-codex-max", + "gpt-5.2" ]; } \ No newline at end of file diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/Anthropic/AnthropicInput.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/Anthropic/AnthropicInput.cs index 1432a6c0..12474b20 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/Anthropic/AnthropicInput.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/Anthropic/AnthropicInput.cs @@ -12,7 +12,7 @@ public sealed class AnthropicInput [JsonPropertyName("max_tokens")] public int? MaxTokens { get; set; } - [JsonPropertyName("messages")] public JsonElement? Messages { get; set; } + [JsonPropertyName("messages")] public IList Messages { get; set; } [JsonPropertyName("tools")] public IList? Tools { get; set; } diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/ThorChatMessage.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/ThorChatMessage.cs index 2de161ed..0777b9f2 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/ThorChatMessage.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/ThorChatMessage.cs @@ -90,6 +90,28 @@ public class ThorChatMessage } } + + /// + /// 用于数据存储 + /// + [JsonIgnore] + public string MessagesStore + { + get + { + if (Content is not null) + { + return Content; + } + + if (Contents is not null && Contents.Any()) + { + return JsonSerializer.Serialize(Contents); + } + return string.Empty; + } + } + /// /// 【可选】参与者的可选名称。提供模型信息以区分相同角色的参与者。 /// diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Enums/GoodsTypeEnum.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Enums/GoodsTypeEnum.cs index 87a2977d..f46ad8c3 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Enums/GoodsTypeEnum.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Enums/GoodsTypeEnum.cs @@ -259,7 +259,7 @@ public static class GoodsTypeEnumExtensions /// /// 计算折扣金额(仅用于尊享包) - /// 规则:每累加充值10元,减少2.5元,最多减少50元 + /// 规则:每累加充值10元,减少10元,最多减少50元 /// /// 商品类型 /// 用户累加充值金额 @@ -271,11 +271,10 @@ public static class GoodsTypeEnumExtensions { return 0m; } - - // 每10元减2.5元 - var discountAmount = Math.Floor(totalRechargeAmount / 2.5m); - - // 最多减少50元 + // 每满 10 元减 10 元 + var discountTimes = Math.Floor(totalRechargeAmount / 10m); + var discountAmount = discountTimes * 10m; + // 最多减少 50 元 return Math.Min(discountAmount, 50m); } diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs index 258a4563..021913a2 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs @@ -242,7 +242,7 @@ public class AiGateWayManager : DomainService catch (Exception e) { _logger.LogError(e, $"Ai对话异常"); - var errorContent = $"对话Ai异常,异常信息:\n当前Ai模型:{request.Model}\n异常信息:{e.Message}\n异常堆栈:{e}"; + var errorContent = $"对话Ai异常,异常信息:\n当前Ai模型:{request.Model}\n异常信息:{e.Message}\n异常堆栈:{e}"; var model = new ThorChatCompletionsResponse() { Choices = new List() @@ -275,7 +275,7 @@ public class AiGateWayManager : DomainService await _aiMessageManager.CreateUserMessageAsync(userId, sessionId, new MessageInputDto { - Content = sessionId is null ? "不予存储" : request.Messages?.LastOrDefault()?.Content ?? string.Empty, + Content = sessionId is null ? "不予存储" : request.Messages?.LastOrDefault()?.MessagesStore ?? string.Empty, ModelId = request.Model, TokenUsage = tokenUsage, }, tokenId); @@ -365,7 +365,7 @@ public class AiGateWayManager : DomainService } catch (Exception e) { - var errorContent = $"图片生成Ai异常,异常信息:\n当前Ai模型:{request.Model}\n异常信息:{e.Message}\n异常堆栈:{e}"; + var errorContent = $"图片生成Ai异常,异常信息:\n当前Ai模型:{request.Model}\n异常信息:{e.Message}\n异常堆栈:{e}"; throw new UserFriendlyException(errorContent); } } @@ -478,7 +478,7 @@ public class AiGateWayManager : DomainService } catch (Exception e) { - var errorContent = $"嵌入Ai异常,异常信息:\n当前Ai模型:{input.Model}\n异常信息:{e.Message}\n异常堆栈:{e}"; + var errorContent = $"嵌入Ai异常,异常信息:\n当前Ai模型:{input.Model}\n异常信息:{e.Message}\n异常堆栈:{e}"; throw new UserFriendlyException(errorContent); } } @@ -595,7 +595,7 @@ public class AiGateWayManager : DomainService catch (Exception e) { _logger.LogError(e, $"Ai对话异常"); - var errorContent = $"对话Ai异常,异常信息:\n当前Ai模型:{request.Model}\n异常信息:{e.Message}\n异常堆栈:{e}"; + var errorContent = $"对话Ai异常,异常信息:\n当前Ai模型:{request.Model}\n异常信息:{e.Message}\n异常堆栈:{e}"; throw new UserFriendlyException(errorContent); } @@ -754,7 +754,7 @@ public class AiGateWayManager : DomainService catch (Exception e) { _logger.LogError(e, $"Ai响应异常"); - var errorContent = $"响应Ai异常,异常信息:\n当前Ai模型:{request.Model}\n异常信息:{e.Message}\n异常堆栈:{e}"; + var errorContent = $"响应Ai异常,异常信息:\n当前Ai模型:{request.Model}\n异常信息:{e.Message}\n异常堆栈:{e}"; throw new UserFriendlyException(errorContent); } diff --git a/Yi.Ai.Vue3/.env.development b/Yi.Ai.Vue3/.env.development index 2403b905..870b6d95 100644 --- a/Yi.Ai.Vue3/.env.development +++ b/Yi.Ai.Vue3/.env.development @@ -15,6 +15,9 @@ VITE_WEB_BASE_API = '/dev-api' VITE_API_URL = http://localhost:19001/api/app #VITE_API_URL=http://data.ccnetcore.com:19001/api/app +# 文件上传接口域名 +VITE_FILE_UPLOAD_API = https://ai.ccnetcore.com + # SSO单点登录url diff --git a/Yi.Ai.Vue3/.env.production b/Yi.Ai.Vue3/.env.production index b2929308..fc6b6f73 100644 --- a/Yi.Ai.Vue3/.env.production +++ b/Yi.Ai.Vue3/.env.production @@ -13,6 +13,9 @@ VITE_WEB_BASE_API = '/prod-api' # 本地接口 VITE_API_URL = http://data.ccnetcore.com:19001/api/app +# 文件上传接口域名 +VITE_FILE_UPLOAD_API = https://ai.ccnetcore.com + # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip diff --git a/Yi.Ai.Vue3/.eslintrc-auto-import.json b/Yi.Ai.Vue3/.eslintrc-auto-import.json deleted file mode 100644 index 313e6711..00000000 --- a/Yi.Ai.Vue3/.eslintrc-auto-import.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "globals": { - "Component": true, - "ComponentPublicInstance": true, - "ComputedRef": true, - "DirectiveBinding": true, - "EffectScope": true, - "ElMessage": true, - "ElMessageBox": true, - "ExtractDefaultPropTypes": true, - "ExtractPropTypes": true, - "ExtractPublicPropTypes": true, - "InjectionKey": true, - "MaybeRef": true, - "MaybeRefOrGetter": true, - "PropType": true, - "Ref": true, - "Slot": true, - "Slots": true, - "VNode": true, - "WritableComputedRef": true, - "computed": true, - "createApp": true, - "customRef": true, - "defineAsyncComponent": true, - "defineComponent": true, - "effectScope": true, - "getCurrentInstance": true, - "getCurrentScope": true, - "h": true, - "inject": true, - "isProxy": true, - "isReactive": true, - "isReadonly": true, - "isRef": true, - "markRaw": true, - "nextTick": true, - "onActivated": true, - "onBeforeMount": true, - "onBeforeUnmount": true, - "onBeforeUpdate": true, - "onDeactivated": true, - "onErrorCaptured": true, - "onMounted": true, - "onRenderTracked": true, - "onRenderTriggered": true, - "onScopeDispose": true, - "onServerPrefetch": true, - "onUnmounted": true, - "onUpdated": true, - "onWatcherCleanup": true, - "provide": true, - "reactive": true, - "readonly": true, - "ref": true, - "resolveComponent": true, - "shallowReactive": true, - "shallowReadonly": true, - "shallowRef": true, - "toRaw": true, - "toRef": true, - "toRefs": true, - "toValue": true, - "triggerRef": true, - "unref": true, - "useAttrs": true, - "useCssModule": true, - "useCssVars": true, - "useId": true, - "useModel": true, - "useSlots": true, - "useTemplateRef": true, - "watch": true, - "watchEffect": true, - "watchPostEffect": true, - "watchSyncEffect": true - } -} diff --git a/Yi.Ai.Vue3/.gitignore b/Yi.Ai.Vue3/.gitignore index 49ef0bd1..9c7ce187 100644 --- a/Yi.Ai.Vue3/.gitignore +++ b/Yi.Ai.Vue3/.gitignore @@ -23,3 +23,10 @@ dist-ssr *.njsproj *.sln *.sw? + +/.eslintrc-auto-import.json +/types/auto-imports.d.ts +/types/components.d.ts +/types/import_meta.d.ts + + diff --git a/Yi.Ai.Vue3/index.html b/Yi.Ai.Vue3/index.html index a5fa06b8..2e2a4b17 100644 --- a/Yi.Ai.Vue3/index.html +++ b/Yi.Ai.Vue3/index.html @@ -112,7 +112,7 @@
-
意心Ai 2.7
+
意心Ai 2.8
海外地址,仅首次访问预计加载约10秒