refactor: replace sjson.Set usage with sjson.SetBytes to optimize mutable JSON transformations
This commit is contained in:
@@ -65,8 +65,8 @@ func NeedConvert(from, to string) bool {
|
||||
// - param: Additional parameters for translation
|
||||
//
|
||||
// Returns:
|
||||
// - []string: The translated response lines
|
||||
func Response(from, to string, ctx context.Context, modelName string, originalRequestRawJSON, requestRawJSON, rawJSON []byte, param *any) []string {
|
||||
// - [][]byte: The translated response lines
|
||||
func Response(from, to string, ctx context.Context, modelName string, originalRequestRawJSON, requestRawJSON, rawJSON []byte, param *any) [][]byte {
|
||||
return registry.TranslateStream(ctx, sdktranslator.FromString(from), sdktranslator.FromString(to), modelName, originalRequestRawJSON, requestRawJSON, rawJSON, param)
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ func Response(from, to string, ctx context.Context, modelName string, originalRe
|
||||
// - param: Additional parameters for translation
|
||||
//
|
||||
// Returns:
|
||||
// - string: The translated response JSON
|
||||
func ResponseNonStream(from, to string, ctx context.Context, modelName string, originalRequestRawJSON, requestRawJSON, rawJSON []byte, param *any) string {
|
||||
// - []byte: The translated response JSON
|
||||
func ResponseNonStream(from, to string, ctx context.Context, modelName string, originalRequestRawJSON, requestRawJSON, rawJSON []byte, param *any) []byte {
|
||||
return registry.TranslateNonStream(ctx, sdktranslator.FromString(from), sdktranslator.FromString(to), modelName, originalRequestRawJSON, requestRawJSON, rawJSON, param)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user