feat: 支持聊天记录存入以及查询的能力 (#158)

This commit is contained in:
二丫讲梵
2023-04-02 20:19:21 +08:00
committed by GitHub
parent 2a5ef877fa
commit b14d6eabcc
15 changed files with 338 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/eryajf/chatgpt-dingtalk/config"
"github.com/eryajf/chatgpt-dingtalk/pkg/cache"
"github.com/eryajf/chatgpt-dingtalk/pkg/db"
"github.com/eryajf/chatgpt-dingtalk/pkg/dingbot"
"github.com/eryajf/chatgpt-dingtalk/pkg/logger"
)
@@ -15,9 +16,14 @@ var Config *config.Configuration
var Prompt *[]config.Prompt
func InitSvc() {
// 加载配置
Config = config.LoadConfig()
// 加载prompt
Prompt = config.LoadPrompt()
// 初始化缓存
UserService = cache.NewUserService()
// 初始化数据库
db.InitDB()
// 暂时不在初始化时获取余额
// if Config.Model == openai.GPT3Dot5Turbo0301 || Config.Model == openai.GPT3Dot5Turbo {
// _, _ = GetBalance()