feat: 新增业务字段路径读写工具
新增 TakeBusinessFields、WriteBusinessFields、SetByPath 与 GetByPath 等工具,支持按映射路径写入请求体与解析响应,并更新相关依赖。
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitea.redpowerfuture.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
type modelTaskEndCol struct {
|
||||
beans.SQLBaseCol
|
||||
ModelId string
|
||||
BizName string
|
||||
MsgTopic string
|
||||
RetryCount string
|
||||
ResponseParams string
|
||||
OriginalResponseParams string
|
||||
DurationSeconds string
|
||||
TaskId string
|
||||
PromptTokens string
|
||||
CompletionTokens string
|
||||
TotalTokens string
|
||||
TotalCost string
|
||||
ErrorMsg string
|
||||
}
|
||||
|
||||
var ModelTaskEndCol = modelTaskEndCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
ModelId: "model_id",
|
||||
BizName: "biz_name",
|
||||
MsgTopic: "msg_topic",
|
||||
RetryCount: "retry_count",
|
||||
ResponseParams: "response_params",
|
||||
OriginalResponseParams: "original_response_params",
|
||||
DurationSeconds: "duration_seconds",
|
||||
TaskId: "task_id",
|
||||
PromptTokens: "prompt_tokens",
|
||||
CompletionTokens: "completion_tokens",
|
||||
TotalTokens: "total_tokens",
|
||||
TotalCost: "total_cost",
|
||||
ErrorMsg: "error_msg",
|
||||
}
|
||||
|
||||
// ModelTaskEnd 模型网关任务
|
||||
type ModelTaskEnd struct {
|
||||
beans.SQLBaseDO `orm:",inline"`
|
||||
ModelId int64 `orm:"model_id" json:"modelId" dc:"模型ID"`
|
||||
BizName string `orm:"biz_name" json:"bizName" dc:"业务名称"`
|
||||
MsgTopic string `orm:"msg_topic" json:"msgTopic" dc:"消息主题"`
|
||||
RetryCount int `orm:"retry_count" json:"retryCount" dc:"重试"`
|
||||
ResponseParams string `orm:"response_params" json:"responseParams" dc:"响应结果"`
|
||||
OriginalResponseParams string `orm:"original_response_params" json:"originalResponseParams" dc:"原始响应结果"`
|
||||
DurationSeconds int64 `orm:"duration_seconds" json:"durationSeconds" dc:"耗时(秒)"`
|
||||
TaskId string `orm:"task_id" json:"taskId" dc:"任务ID"`
|
||||
PromptTokens int64 `orm:"prompt_tokens" json:"promptTokens" dc:"输入token"`
|
||||
CompletionTokens int64 `orm:"completion_tokens" json:"completionTokens" dc:"输出token"`
|
||||
TotalTokens int64 `orm:"total_tokens" json:"totalTokens" dc:"总token"`
|
||||
TotalCost float64 `orm:"total_cost" json:"totalCost" dc:"本次调用总费用(元),未配置计费规则为0"`
|
||||
ErrorMsg string `orm:"error_msg" json:"errorMsg" dc:"错误消息"`
|
||||
}
|
||||
Reference in New Issue
Block a user