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

This commit is contained in:
CaIon committed 2025-08-23 13:12:15 +08:00
1 parent 858585d974
commit 1ee3d1cc50
20 files changed
+273 -106

No files matched your search

+21
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
}