Feature/model - #35
Merged
Merged
Conversation
- users 表扩展:department/position/expertise/preferred_language/timezone 画像字段 - 新增 UserPreference Entity + Repository 接口与实现(用户偏好 CRUD + 按 user_id 唯一查询) - 调整 UserRepository.UpdateProfile 支持画像字段局部更新,移除 role_template_id 关联 - 请求/响应 DTO:用户画像 5 字段 + 偏好 8 字段,移除角色模板请求响应结构
- UserService 依赖拆分:依赖 UserPreferenceService 接口,Remove RoleTemplateService 全链路引用 - UserPreferenceService 接口:GetByUserID/Upsert/ToDTO,默认偏好兜底+按 user_id 唯一约束 - profile 接口/实现分离:profile_interface.go 定义接口,profile_service.go 保留实现,符合分层规范 - 画像更新校验:部门/职位/擅长字段长度校验,偏好枚举值校验(answer_style/citation_style 取值范围)
- EnhancedContext 扩展 Profile/Preference 字段,移除 RoleTemplate 引用 - PromptBuilder 双模式一致:WithProfile/WithPreference,删除 WithRoleTemplate - chat_service 上下文增强:CreateUserContext+BuildPromptBuilder 快/深度模式统一调用 - Prompt 内容调整:画像5字段+偏好3字段(answer_style/table_first/citation_style) 注入到 UserContext - chat_mode 快速/深度模式构建Prompt均走 PromptBuilder,保证一致性,移除模板注入链路
- 用户模块 Controller:新增 GetProfile/UpdateProfile/GetPreference/UpsertPreference 4个接口 - 移除角色模板全部6条路由(/api/v1/users/role-templates* + set-default) - Router 聚合 NewRouter:移除 roleTemplateSvc 参数,用户 Controller 构造函数同步减少传参 - 错误码 pkg/errors:用户画像/偏好错误码段调整至14xxx,避免与模型额度12xxx段冲突
- internal/agent:修正 ReAct 执行与请求类型,适配 PromptUserContext 新字段(移除 RoleTemplatePrompt) - internal/app/app.go:移除 roleTemplateRepo/roleTemplateSvc 实例,NewUserService/NewChatService/NewRouter 各减一参 - 装配链路对齐:prefSvc 仅 1 个偏好服务,不再有模板服务,编译验证通过
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.