feat: 修复重试后请求结构混乱,修复rerank端点无法使用

This commit is contained in:
CaIon
2025-08-23 13:12:15 +08:00
parent e581422810
commit 4f23e53002
20 changed files with 273 additions and 106 deletions

21
common/copy.go Normal file
View File

@@ -0,0 +1,21 @@
package common
import (
"fmt"
"github.com/antlabs/pcopy"
)
func DeepCopy[T any](src *T) (*T, error) {
if src == nil {
return nil, fmt.Errorf("copy source cannot be nil")
}
var dst T
err := pcopy.Copy(&dst, src)
if err != nil {
return nil, err
}
if &dst == nil {
return nil, fmt.Errorf("copy result cannot be nil")
}
return &dst, nil
}