refactor: replace sjson.Set usage with sjson.SetBytes to optimize mutable JSON transformations
This commit is contained in:
@@ -16,7 +16,7 @@ type ResponseEnvelope struct {
|
||||
Model string
|
||||
Stream bool
|
||||
Body []byte
|
||||
Chunks []string
|
||||
Chunks [][]byte
|
||||
}
|
||||
|
||||
// RequestMiddleware decorates request translation.
|
||||
@@ -87,7 +87,7 @@ func (p *Pipeline) TranslateResponse(ctx context.Context, from, to Format, resp
|
||||
if input.Stream {
|
||||
input.Chunks = p.registry.TranslateStream(ctx, from, to, input.Model, originalReq, translatedReq, input.Body, param)
|
||||
} else {
|
||||
input.Body = []byte(p.registry.TranslateNonStream(ctx, from, to, input.Model, originalReq, translatedReq, input.Body, param))
|
||||
input.Body = p.registry.TranslateNonStream(ctx, from, to, input.Model, originalReq, translatedReq, input.Body, param)
|
||||
}
|
||||
input.Format = to
|
||||
return input, nil
|
||||
|
||||
Reference in New Issue
Block a user