Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
59c5f425
authored
Oct 11, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add logging for model details and enhance action assignment in relay tasks
parent
d540020c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
relay/common/relay_utils.go
+2
-1
relay/relay_task.go
+6
-5
web/src/hooks/usage-logs/useUsageLogsData.jsx
+6
-0
No files found.
relay/common/relay_utils.go
View file @
59c5f425
...
@@ -173,7 +173,6 @@ func ValidateMultipartDirect(c *gin.Context, info *RelayInfo) *dto.TaskError {
...
@@ -173,7 +173,6 @@ func ValidateMultipartDirect(c *gin.Context, info *RelayInfo) *dto.TaskError {
if
hasInputReference
{
if
hasInputReference
{
action
=
constant
.
TaskActionGenerate
action
=
constant
.
TaskActionGenerate
}
}
info
.
Action
=
action
if
strings
.
HasPrefix
(
model
,
"sora-2"
)
{
if
strings
.
HasPrefix
(
model
,
"sora-2"
)
{
if
size
==
""
{
if
size
==
""
{
...
@@ -199,6 +198,8 @@ func ValidateMultipartDirect(c *gin.Context, info *RelayInfo) *dto.TaskError {
...
@@ -199,6 +198,8 @@ func ValidateMultipartDirect(c *gin.Context, info *RelayInfo) *dto.TaskError {
}
}
}
}
info
.
Action
=
action
return
nil
return
nil
}
}
...
...
relay/relay_task.go
View file @
59c5f425
...
@@ -78,6 +78,7 @@ func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (taskErr *dto.
...
@@ -78,6 +78,7 @@ func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (taskErr *dto.
}
}
}
}
}
}
println
(
fmt
.
Sprintf
(
"model: %s, model_price: %.4f, group: %s, group_ratio: %.4f, final_ratio: %.4f"
,
modelName
,
modelPrice
,
info
.
UsingGroup
,
groupRatio
,
ratio
))
userQuota
,
err
:=
model
.
GetUserQuota
(
info
.
UserId
,
false
)
userQuota
,
err
:=
model
.
GetUserQuota
(
info
.
UserId
,
false
)
if
err
!=
nil
{
if
err
!=
nil
{
taskErr
=
service
.
TaskErrorWrapper
(
err
,
"get_user_quota_failed"
,
http
.
StatusInternalServerError
)
taskErr
=
service
.
TaskErrorWrapper
(
err
,
"get_user_quota_failed"
,
http
.
StatusInternalServerError
)
...
@@ -146,11 +147,11 @@ func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (taskErr *dto.
...
@@ -146,11 +147,11 @@ func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (taskErr *dto.
}
}
if
quota
!=
0
{
if
quota
!=
0
{
tokenName
:=
c
.
GetString
(
"token_name"
)
tokenName
:=
c
.
GetString
(
"token_name"
)
gRatio
:=
groupRatio
//
gRatio := groupRatio
if
hasUserGroupRatio
{
//
if hasUserGroupRatio {
gRatio
=
userGroupRatio
//
gRatio = userGroupRatio
}
//
}
logContent
:=
fmt
.
Sprintf
(
"
模型固定价格 %.2f,分组倍率 %.2f,操作 %s"
,
modelPrice
,
gRatio
,
info
.
Action
)
logContent
:=
fmt
.
Sprintf
(
"
操作 %s"
,
info
.
Action
)
if
len
(
info
.
PriceData
.
OtherRatios
)
>
0
{
if
len
(
info
.
PriceData
.
OtherRatios
)
>
0
{
var
contents
[]
string
var
contents
[]
string
for
key
,
ra
:=
range
info
.
PriceData
.
OtherRatios
{
for
key
,
ra
:=
range
info
.
PriceData
.
OtherRatios
{
...
...
web/src/hooks/usage-logs/useUsageLogsData.jsx
View file @
59c5f425
...
@@ -377,6 +377,12 @@ export const useLogsData = () => {
...
@@ -377,6 +377,12 @@ export const useLogsData = () => {
other
.
file_search_call_count
||
0
,
other
.
file_search_call_count
||
0
,
),
),
});
});
if
(
logs
[
i
]?.
content
)
{
expandDataLocal
.
push
({
key
:
t
(
'其他详情'
),
value
:
logs
[
i
].
content
,
});
}
}
}
if
(
logs
[
i
].
type
===
2
)
{
if
(
logs
[
i
].
type
===
2
)
{
let
modelMapped
=
let
modelMapped
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment