新增 TakeBusinessFields、WriteBusinessFields、SetByPath 与 GetByPath 等工具,支持按映射路径写入请求体与解析响应,并更新相关依赖。
33 lines
1.6 KiB
Go
33 lines
1.6 KiB
Go
package dto
|
|
|
|
import "model-gateway/model/entity"
|
|
|
|
type CallModelSessionReq struct {
|
|
Id int64 `json:"id" v:"required#id不能为空" dc:"任务ID"`
|
|
ModelInfo *entity.ModelManage `json:"modelInfo" dc:"模型信息"`
|
|
RequestParams map[string]any `json:"requestParams" dc:"新请求参数"`
|
|
}
|
|
|
|
// CreateModelSessionReq 创建会话
|
|
type CreateModelSessionReq struct {
|
|
ModelId int64 `json:"modelId" dc:"模型ID"`
|
|
BizName string `json:"bizName" dc:"业务名称(调用方模块/系统,用于统计)"`
|
|
SessionId string `json:"sessionId" v:"required#sessionId不能为空" dc:"会话ID"`
|
|
RequestPath string `json:"requestPath" dc:"请求参数保存路径"`
|
|
OriginalRequestPath string `json:"originalRequestPath" dc:"原始请求参数保存路径"`
|
|
}
|
|
|
|
// UpdateModelSessionReq 修改会话
|
|
type UpdateModelSessionReq struct {
|
|
Id int64 `json:"id" v:"required#id不能为空" dc:"任务ID"`
|
|
RetryCount int `json:"retryCount" dc:"重试"`
|
|
ResponsePath string `json:"responsePath" dc:"响应结果保存路径"`
|
|
OriginalResponsePath string `json:"originalResponsePath" dc:"原始响应结果保存路径"`
|
|
DurationSeconds int64 `json:"durationSeconds" dc:"耗时(秒)"`
|
|
PromptTokens int64 `json:"promptTokens" dc:"输入token"`
|
|
CompletionTokens int64 `json:"completionTokens" dc:"输出token"`
|
|
TotalTokens int64 `json:"totalTokens" dc:"总token"`
|
|
TotalCost float64 `json:"totalCost" dc:"总费用(元)"`
|
|
ErrorMsg string `json:"errorMsg" dc:"错误消息"`
|
|
}
|