Compare commits

..

No commits in common. "418b6e033964abb3834e78c08a832f278e32ce0d" and "0e055d5b5a6c3f8f93a29d73638afe6d652bac22" have entirely different histories.

4 changed files with 22 additions and 34 deletions

View File

@ -93,9 +93,7 @@ func (h *Hsyq) CreateResponse(ctx context.Context, key string, modelName string,
}, },
}, },
Stream: new(bool), Stream: new(bool),
Reasoning: &responses.ResponsesReasoning{Effort: responses.ReasoningEffort_minimal},
Thinking: &responses.ResponsesThinking{Type: responses.ThinkingType_disabled.Enum()}, Thinking: &responses.ResponsesThinking{Type: responses.ThinkingType_disabled.Enum()},
Text: &responses.ResponsesText{Format: &responses.TextFormat{Type: responses.TextType_json_object}},
} }
if isRegis { if isRegis {
prefix := true prefix := true
@ -128,7 +126,6 @@ func (h *Hsyq) RequestHsyqJson(ctx context.Context, key string, modelName string
}, },
}, },
Stream: new(bool), Stream: new(bool),
Thinking: &responses.ResponsesThinking{Type: responses.ThinkingType_disabled.Enum()}, Thinking: &responses.ResponsesThinking{Type: responses.ThinkingType_disabled.Enum()},
Text: &responses.ResponsesText{Format: &responses.TextFormat{Type: responses.TextType_json_object}}, Text: &responses.ResponsesText{Format: &responses.TextFormat{Type: responses.TextType_json_object}},
} }

View File

@ -21,7 +21,7 @@ import (
func Test_WordAna(t *testing.T) { func Test_WordAna(t *testing.T) {
Run(context.Background(), nil) Run(context.Background(), nil)
ana, err := fileService.WordAnat("https://attachment-public.oss-cn-hangzhou.aliyuncs.com/ai-scheduler/data-analytics/word/content2.docx") ana, err := file.WordAnat("https://attachment-public.oss-cn-hangzhou.aliyuncs.com/ai-scheduler/data-analytics/word/content2.docx")
t.Log(ana, err) t.Log(ana, err)
} }
@ -29,35 +29,35 @@ func Test_AdvicerInit(t *testing.T) {
reqBody := `{"advicer_id": 124, "name": "张三111", "birth": "1990-01-01", "gender": 1, "working_years": 10}` reqBody := `{"advicer_id": 124, "name": "张三111", "birth": "1990-01-01", "gender": 1, "working_years": 10}`
Run(context.Background(), []byte(reqBody)) Run(context.Background(), []byte(reqBody))
err := advicerService.AdvicerUpdate(fiberCtx) err := advicer.AdvicerUpdate(fiberCtx)
t.Log(err) t.Log(err)
} }
func Test_AdvicerVersionAdd(t *testing.T) { func Test_AdvicerVersionAdd(t *testing.T) {
reqBody := `{"advicerId":124,"versionDesc":"第三个版本","dialectFeatures":{"region":"四川成都话","intensity":0.6,"KeyWords":null},"personalityTags":["耐心细致","专业务实","经验丰富","善于引导"],"sentencePatterns":{"openingMode":["我给你介绍一下","我们先来看一下","这边请"],"explanationMode":["是这样的","我跟你讲","你发现没得","说白了"],"confirmationMode":["对吧?","是不是嘛?","你晓得不?","明白了噻?","对不对?"],"summaryMode":["所以说","简单说就是","其实"],"transitionMode":["然后的话","再其次","还有一点","另外"]},"signatureDialogues":[{"context":"客户质疑地块大小","dialogue":"哥14亩确实不大但你要在成都2.5环内城买房这种是普遍现象。你看万景和绿城都是13亩中铁建只有8.8亩339那个帮泰只有11亩。我们虽然地小但楼间距开阔啊看过去都是200多米而且小小区人少安静圈层更纯粹"},{"context":"客户担心物业费高","dialogue":"姐我懂你意思我们也觉得物业费是有点贵。但招商物业是铂金服务有夜间送外卖、免费宠物喂养、年度保洁这些增值服务。而且前三年开发商补贴一块钱只需要交5块跟其他盘差不多好物业能让房子后期保值增值更多"},{"context":"客户犹豫价格","dialogue":"说实话这个地段的地价都比二八板块贵5000多但我们单价只贵3000。你看龙湖滨江云河颂套内单价都36000了我们才33000真的性价比高现在不买以后这个板块可能就买不起了。"},{"context":"客户担心小区小不保值","dialogue":"哥你不用担心小地块不保值东大街的九龙仓擎天半岛只有两栋楼现在二手房还能卖3万左右是当年的豪宅项目。还有望江名门、仁和春天29号院都是小地块但照样是高端保值盘。核心还是地段我们在槐树店这个成华区最贵的板块保值根本没问题"}],"toneTags":{"enthusiasm":0.8,"patience":0.9,"confidence":0.85,"friendliness":0.8,"persuasion":0.75}}` reqBody := `{"advicerId":124,"versionDesc":"第三个版本","dialectFeatures":{"region":"四川成都话","intensity":0.6,"KeyWords":null},"personalityTags":["耐心细致","专业务实","经验丰富","善于引导"],"sentencePatterns":{"openingMode":["我给你介绍一下","我们先来看一下","这边请"],"explanationMode":["是这样的","我跟你讲","你发现没得","说白了"],"confirmationMode":["对吧?","是不是嘛?","你晓得不?","明白了噻?","对不对?"],"summaryMode":["所以说","简单说就是","其实"],"transitionMode":["然后的话","再其次","还有一点","另外"]},"signatureDialogues":[{"context":"客户质疑地块大小","dialogue":"哥14亩确实不大但你要在成都2.5环内城买房这种是普遍现象。你看万景和绿城都是13亩中铁建只有8.8亩339那个帮泰只有11亩。我们虽然地小但楼间距开阔啊看过去都是200多米而且小小区人少安静圈层更纯粹"},{"context":"客户担心物业费高","dialogue":"姐我懂你意思我们也觉得物业费是有点贵。但招商物业是铂金服务有夜间送外卖、免费宠物喂养、年度保洁这些增值服务。而且前三年开发商补贴一块钱只需要交5块跟其他盘差不多好物业能让房子后期保值增值更多"},{"context":"客户犹豫价格","dialogue":"说实话这个地段的地价都比二八板块贵5000多但我们单价只贵3000。你看龙湖滨江云河颂套内单价都36000了我们才33000真的性价比高现在不买以后这个板块可能就买不起了。"},{"context":"客户担心小区小不保值","dialogue":"哥你不用担心小地块不保值东大街的九龙仓擎天半岛只有两栋楼现在二手房还能卖3万左右是当年的豪宅项目。还有望江名门、仁和春天29号院都是小地块但照样是高端保值盘。核心还是地段我们在槐树店这个成华区最贵的板块保值根本没问题"}],"toneTags":{"enthusiasm":0.8,"patience":0.9,"confidence":0.85,"friendliness":0.8,"persuasion":0.75}}`
Run(context.Background(), []byte(reqBody)) Run(context.Background(), []byte(reqBody))
err := advicerService.AdvicerVersionAdd(fiberCtx) err := advicer.AdvicerVersionAdd(fiberCtx)
t.Log(err) t.Log(err)
} }
func Test_AdvicerVersionUpdate(t *testing.T) { func Test_AdvicerVersionUpdate(t *testing.T) {
reqBody := `{"id":"69804b5a6532131383aeda3a","advicerId":124,"versionDesc":"第三个版本","dialectFeatures":{"region":"四川成都话","intensity":0.6,"KeyWords":null},"personalityTags":["耐心细致","专业务实","经验丰富","善于引导"],"sentencePatterns":{"openingMode":["我给你介绍一下","我们先来看一下","这边请"],"explanationMode":["是这样的","我跟你讲","你发现没得","说白了"],"confirmationMode":["对吧?","是不是嘛?","你晓得不?","明白了噻?","对不对?"],"summaryMode":["所以说","简单说就是","其实"],"transitionMode":["然后的话","再其次","还有一点","另外"]},"signatureDialogues":[{"context":"客户质疑地块大小","dialogue":"哥14亩确实不大但你要在成都2.5环内城买房这种是普遍现象。你看万景和绿城都是13亩中铁建只有8.8亩339那个帮泰只有11亩。我们虽然地小但楼间距开阔啊看过去都是200多米而且小小区人少安静圈层更纯粹"},{"context":"客户担心物业费高","dialogue":"姐我懂你意思我们也觉得物业费是有点贵。但招商物业是铂金服务有夜间送外卖、免费宠物喂养、年度保洁这些增值服务。而且前三年开发商补贴一块钱只需要交5块跟其他盘差不多好物业能让房子后期保值增值更多"},{"context":"客户犹豫价格","dialogue":"说实话这个地段的地价都比二八板块贵5000多但我们单价只贵3000。你看龙湖滨江云河颂套内单价都36000了我们才33000真的性价比高现在不买以后这个板块可能就买不起了。"},{"context":"客户担心小区小不保值","dialogue":"哥你不用担心小地块不保值东大街的九龙仓擎天半岛只有两栋楼现在二手房还能卖3万左右是当年的豪宅项目。还有望江名门、仁和春天29号院都是小地块但照样是高端保值盘。核心还是地段我们在槐树店这个成华区最贵的板块保值根本没问题"}],"toneTags":{"enthusiasm":0.8,"patience":0.9,"confidence":0.85,"friendliness":0.8,"persuasion":0.75}}` reqBody := `{"id":"69804b5a6532131383aeda3a","advicerId":124,"versionDesc":"第三个版本","dialectFeatures":{"region":"四川成都话","intensity":0.6,"KeyWords":null},"personalityTags":["耐心细致","专业务实","经验丰富","善于引导"],"sentencePatterns":{"openingMode":["我给你介绍一下","我们先来看一下","这边请"],"explanationMode":["是这样的","我跟你讲","你发现没得","说白了"],"confirmationMode":["对吧?","是不是嘛?","你晓得不?","明白了噻?","对不对?"],"summaryMode":["所以说","简单说就是","其实"],"transitionMode":["然后的话","再其次","还有一点","另外"]},"signatureDialogues":[{"context":"客户质疑地块大小","dialogue":"哥14亩确实不大但你要在成都2.5环内城买房这种是普遍现象。你看万景和绿城都是13亩中铁建只有8.8亩339那个帮泰只有11亩。我们虽然地小但楼间距开阔啊看过去都是200多米而且小小区人少安静圈层更纯粹"},{"context":"客户担心物业费高","dialogue":"姐我懂你意思我们也觉得物业费是有点贵。但招商物业是铂金服务有夜间送外卖、免费宠物喂养、年度保洁这些增值服务。而且前三年开发商补贴一块钱只需要交5块跟其他盘差不多好物业能让房子后期保值增值更多"},{"context":"客户犹豫价格","dialogue":"说实话这个地段的地价都比二八板块贵5000多但我们单价只贵3000。你看龙湖滨江云河颂套内单价都36000了我们才33000真的性价比高现在不买以后这个板块可能就买不起了。"},{"context":"客户担心小区小不保值","dialogue":"哥你不用担心小地块不保值东大街的九龙仓擎天半岛只有两栋楼现在二手房还能卖3万左右是当年的豪宅项目。还有望江名门、仁和春天29号院都是小地块但照样是高端保值盘。核心还是地段我们在槐树店这个成华区最贵的板块保值根本没问题"}],"toneTags":{"enthusiasm":0.8,"patience":0.9,"confidence":0.85,"friendliness":0.8,"persuasion":0.75}}`
Run(context.Background(), []byte(reqBody)) Run(context.Background(), []byte(reqBody))
err := advicerService.AdvicerVersionUpdate(fiberCtx) err := advicer.AdvicerVersionUpdate(fiberCtx)
t.Log(err) t.Log(err)
} }
func Test_VersionList(t *testing.T) { func Test_VersionList(t *testing.T) {
reqBody := `{"id":"69804060c17976e5e21858a8"}` reqBody := `{"id":"69804060c17976e5e21858a8"}`
Run(context.Background(), []byte(reqBody)) Run(context.Background(), []byte(reqBody))
err := advicerService.AdvicerVersionList(fiberCtx) err := advicer.AdvicerVersionList(fiberCtx)
t.Log(err) t.Log(err)
} }
func Test_AdvicerVersionDel(t *testing.T) { func Test_AdvicerVersionDel(t *testing.T) {
reqBody := `{"id":"698056073059550befc4f0da"}` reqBody := `{"id":"698056073059550befc4f0da"}`
Run(context.Background(), []byte(reqBody)) Run(context.Background(), []byte(reqBody))
err := advicerService.AdvicerVersionDel(fiberCtx) err := advicer.AdvicerVersionDel(fiberCtx)
t.Log(err) t.Log(err)
} }
@ -93,9 +93,8 @@ func Test_Json(t *testing.T) {
} }
var ( var (
fileService *FileService file *FileService
advicerService *AdvicerService advicer *AdvicerService
adviceChatService *ChatService
configConfig *config.Config configConfig *config.Config
fiberCtx *fiber.Ctx fiberCtx *fiber.Ctx
) )
@ -116,31 +115,23 @@ func Run(ctx context.Context, reqBody []byte) {
rdb := utils.NewRdb(configConfig) rdb := utils.NewRdb(configConfig)
advicerImpl := impl.NewAdviceAdvicerImpl(db) advicerImpl := impl.NewAdviceAdvicerImpl(db)
advicerVersionMongo := mongo_model.NewAdvicerVersionMongo() advicerVersionMongo := mongo_model.NewAdvicerVersionMongo()
advicerChatHisMongo := mongo_model.NewAdvicerChatHisMongo()
aiAdviceModelSupImpl := impl.NewAiAdviceModelSupImpl(db)
aiAdviceSessionImpl := impl.NewAiAdviceSessionImpl(db)
advicerTalkSkillMongo := mongo_model.NewAdvicerTalkSkillMongo() advicerTalkSkillMongo := mongo_model.NewAdvicerTalkSkillMongo()
advicerClientMongo := mongo_model.NewAdvicerClientMongo() advicerClientMongo := mongo_model.NewAdvicerClientMongo()
advicerProjectMongo := mongo_model.NewAdvicerProjectMongo() advicerProjectMongo := mongo_model.NewAdvicerProjectMongo()
hsyq := third_party.NewHsyq() hsyq := third_party.NewHsyq()
advicerfilebiz := biz.NewAdviceFileBiz(hsyq)
adviceProjectImpl := impl.NewAdviceProjectImpl(db)
mongo, _ := pkg.NewMongoDb(ctx, configConfig) mongo, _ := pkg.NewMongoDb(ctx, configConfig)
adviceAdvicerBiz := biz.NewAdviceAdvicerBiz(advicerImpl, advicerVersionMongo, mongo) adviceAdvicerBiz := biz.NewAdviceAdvicerBiz(advicerImpl, advicerVersionMongo, mongo)
adviceChatBiz := biz.NewAdviceChatBiz(hsyq, rdb, aiAdviceSessionImpl, aiAdviceModelSupImpl, advicerChatHisMongo, mongo)
skillBiz := biz.NewAdviceSkillBiz(advicerTalkSkillMongo, mongo) skillBiz := biz.NewAdviceSkillBiz(advicerTalkSkillMongo, mongo)
clientBiz := biz.NewAdviceClientBiz(advicerClientMongo, mongo) clientBiz := biz.NewAdviceClientBiz(advicerClientMongo, mongo)
adviceFileBiz := biz.NewAdviceFileBiz(hsyq) projectBiz := biz.NewAdviceProjectBiz(advicerProjectMongo, mongo)
adviceProjectBiz := biz.NewAdviceProjectBiz(advicerProjectMongo, adviceProjectImpl, aiAdviceModelSupImpl, mongo) chatBiz := biz.NewAdviceChatBiz(hsyq, rdb)
adviceClientBiz := biz.NewAdviceClientBiz(advicerClientMongo, mongo) file = NewFileService(advicerfilebiz, configConfig)
adviceSkillBiz := biz.NewAdviceSkillBiz(advicerTalkSkillMongo, mongo) advicer = NewAdvicerService(adviceAdvicerBiz, configConfig)
fileService = NewFileService(adviceFileBiz, configConfig, adviceProjectBiz)
advicerService = NewAdvicerService(adviceAdvicerBiz, configConfig)
skill = NewTalkSkillService(skillBiz, configConfig) skill = NewTalkSkillService(skillBiz, configConfig)
client = NewClientService(clientBiz, configConfig) client = NewClientService(clientBiz, configConfig)
project = NewProjectService(adviceProjectBiz, configConfig) project = NewProjectService(projectBiz, configConfig)
adviceChatService = NewChatService(adviceChatBiz, adviceClientBiz, adviceAdvicerBiz, adviceProjectBiz, adviceSkillBiz, configConfig) chat = NewChatService(chatBiz, clientBiz, adviceAdvicerBiz, projectBiz, skillBiz, configConfig)
} }
var dataMap = map[string]mongo_model.AdviceData{ var dataMap = map[string]mongo_model.AdviceData{

View File

@ -9,7 +9,7 @@ import (
) )
func Test_Regis(t *testing.T) { func Test_Regis(t *testing.T) {
reqBody := `{"advicerVersionId":"698315725d0077330399f704","clientId":"69819b3403152e79c5ac8ca9","talkSkillId":"6980651219c4ac11078c341e"}` reqBody := `{"advicerVersionId":"698315725d0077330399f704","clientId":"698199fa0c5f4ae098e009ab","talkSkillId":"698063ff5215bdb9c6344e88"}`
Run(context.Background(), []byte(reqBody)) Run(context.Background(), []byte(reqBody))
err := chat.Regis(fiberCtx) err := chat.Regis(fiberCtx)
t.Log(err) t.Log(err)

View File

@ -30,7 +30,7 @@ func Test_ClientList(t *testing.T) {
func Test_ClientDel(t *testing.T) { func Test_ClientDel(t *testing.T) {
reqBody := `{"id":"698056073059550befc4f0da"}` reqBody := `{"id":"698056073059550befc4f0da"}`
Run(context.Background(), []byte(reqBody)) Run(context.Background(), []byte(reqBody))
err := advicerService.AdvicerVersionDel(fiberCtx) err := advicer.AdvicerVersionDel(fiberCtx)
t.Log(err) t.Log(err)
} }