refactor(model-gateway): 重构代码结构并优化数据库查询
This commit is contained in:
@@ -6,7 +6,8 @@ type ComposeMessagesReq struct {
|
||||
g.Meta `path:"/composeMessages" method:"post" tags:"提示词处理" summary:"拼接提示词" dc:"按 modelTypeId 读取 prompts_model_prompt.prompt_info 与 response_json_schema;form 作为系统表单,userForm 作为用户表单,结合 userFiles 调用 model-gateway,并直接返回最终 messages"`
|
||||
ModelName string `p:"modelName" json:"modelName" v:"required#modelName不能为空" dc:"实际请求的网关模型名称"`
|
||||
BuildType int `p:"buildType" json:"buildType" v:"required#buildType不能为空" dc:"构建类型"` //判断节点
|
||||
SessionId string `p:"sessionId" json:"sessionId" dc:"会话ID"` //v:"required#sessionId不能为空"
|
||||
NodeId string `p:"nodeId" json:"nodeId" dc:"节点ID"`
|
||||
SessionId string `p:"sessionId" json:"sessionId" dc:"会话ID"` //v:"required#sessionId不能为空"
|
||||
Cause string `p:"cause" json:"cause" v:"required-if:IsBuilder,false#原因不能为空" dc:"原因"`
|
||||
CallbackUrl string `p:"callbackUrl" json:"callbackUrl" dc:"回调地址"`
|
||||
Form []map[string]any `p:"form" json:"form" dc:"系统表单:form 下所有字段都作为系统提示词来源"`
|
||||
@@ -59,11 +60,3 @@ type GetComposeTaskRes struct {
|
||||
OssFile string `json:"ossFile" dc:"结果文件地址"`
|
||||
FileType string `json:"fileType" dc:"结果文件类型"`
|
||||
}
|
||||
|
||||
type TextReq struct {
|
||||
g.Meta `path:"/text" method:"post" tags:"提示词处理" summary:"拼接提示词" dc:"按 modelTypeId 读取 prompts_model_prompt.prompt_info 与 response_json_schema;form 作为系统表单,userForm 作为用户表单,结合 userFiles 调用 model-gateway,并直接返回最终 messages"`
|
||||
}
|
||||
|
||||
type TextRes struct {
|
||||
Messages any `json:"messages" dc:"文本结果"`
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import "gitea.com/red-future/common/beans"
|
||||
type ComposeSession struct {
|
||||
beans.SQLBaseDO `orm:",inline"`
|
||||
SessionId string `orm:"session_id" json:"sessionId"`
|
||||
NodeId string `orm:"node_id" json:"nodeId"`
|
||||
RequestContent map[string]any `orm:"request_content" json:"requestContent"`
|
||||
ResponseContent map[string]any `orm:"response_content" json:"responseContent"`
|
||||
Remark string `orm:"remark" json:"remark"`
|
||||
@@ -13,6 +14,7 @@ type ComposeSession struct {
|
||||
type composeSessionCol struct {
|
||||
beans.SQLBaseCol
|
||||
SessionId string
|
||||
NodeId string
|
||||
RequestContent string
|
||||
ResponseContent string
|
||||
Remark string
|
||||
@@ -21,6 +23,7 @@ type composeSessionCol struct {
|
||||
var ComposeSessionCol = composeSessionCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
SessionId: "session_id",
|
||||
NodeId: "node_id",
|
||||
RequestContent: "request_content",
|
||||
ResponseContent: "response_content",
|
||||
Remark: "remark",
|
||||
|
||||
Reference in New Issue
Block a user