diff --git a/.gitignore b/.gitignore index 2341b8f3..d6e49d87 100644 --- a/.gitignore +++ b/.gitignore @@ -280,7 +280,3 @@ database_backup package-lock.json .claude -.eslintrc-auto-import.json -auto-imports.d.ts -components.d.ts -import_meta.d.ts 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/Managers/AiGateWayManager.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs index 1ab7ffd5..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 @@ -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); 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/types/import_meta.d.ts b/Yi.Ai.Vue3/types/import_meta.d.ts index c98d612e..8f2a798b 100644 --- a/Yi.Ai.Vue3/types/import_meta.d.ts +++ b/Yi.Ai.Vue3/types/import_meta.d.ts @@ -7,7 +7,6 @@ interface ImportMetaEnv { readonly VITE_WEB_BASE_API: string; readonly VITE_API_URL: string; readonly VITE_FILE_UPLOAD_API: string; - readonly VITE_BUILD_COMPRESS: string; readonly VITE_SSO_SEVER_URL: string; readonly VITE_APP_VERSION: string; }