feat: 迁移plant
This commit is contained in:
@@ -5,6 +5,7 @@ package ai
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"sundynix-micro-go/app/plant/api/internal/svc"
|
||||
"sundynix-micro-go/app/plant/api/internal/types"
|
||||
@@ -27,8 +28,8 @@ func NewAiChatLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AiChatLogi
|
||||
}
|
||||
}
|
||||
|
||||
func (l *AiChatLogic) AiChat(req *types.AiChatReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
func (l *AiChatLogic) AiChat(req *types.AiChatReq) (string, error) {
|
||||
l.Logger.Infof("AI chat request: %s", req.Question)
|
||||
userID := fmt.Sprintf("%v", l.ctx.Value("userId"))
|
||||
return ChatCompletion(l.ctx, l.svcCtx, userID, req.Question)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user