mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-10 11:13:42 +08:00
feat: chat chrawing function is refactored
This commit is contained in:
@@ -48,6 +48,7 @@ func (f FuncMidJourney) Invoke(params map[string]interface{}) (string, error) {
|
||||
f.service.PushTask(service.MjTask{
|
||||
Id: utils.InterfaceToString(params["session_id"]),
|
||||
Src: service.TaskSrcChat,
|
||||
Type: service.Image,
|
||||
Prompt: prompt,
|
||||
UserId: utils.IntValue(utils.InterfaceToString(params["user_id"]), 0),
|
||||
RoleId: utils.IntValue(utils.InterfaceToString(params["role_id"]), 0),
|
||||
|
||||
@@ -3,6 +3,7 @@ package function
|
||||
import (
|
||||
"chatplus/core/types"
|
||||
logger2 "chatplus/logger"
|
||||
"chatplus/service"
|
||||
)
|
||||
|
||||
type Function interface {
|
||||
@@ -28,11 +29,11 @@ type dataItem struct {
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
func NewFunctions(config *types.AppConfig) map[string]Function {
|
||||
func NewFunctions(config *types.AppConfig, mjService *service.MjService) map[string]Function {
|
||||
return map[string]Function{
|
||||
types.FuncZaoBao: NewZaoBao(config.ApiConfig),
|
||||
types.FuncWeibo: NewWeiboHot(config.ApiConfig),
|
||||
types.FuncHeadLine: NewHeadLines(config.ApiConfig),
|
||||
types.FuncMidJourney: NewMidJourneyFunc(config.ExtConfig),
|
||||
types.FuncMidJourney: NewMidJourneyFunc(mjService),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user