MCPcopy Index your code
hub / github.com/mudler/LocalAI / rewriteModel

Function rewriteModel

core/services/cloudproxy/proxy.go:19–29  ·  view source on GitHub ↗
(body []byte, upstreamModel string)

Source from the content-addressed store, hash-verified

17)
18
19func rewriteModel(body []byte, upstreamModel string) ([]byte, error) {
20 if upstreamModel == "" {
21 return body, nil
22 }
23 var m map[string]any
24 if err := json.Unmarshal(body, &m); err != nil {
25 return nil, fmt.Errorf("cloudproxy: parse request body: %w", err)
26 }
27 m["model"] = upstreamModel
28 return json.Marshal(m)
29}
30
31func streaming(body []byte) bool {
32 var probe struct {

Callers 2

ForwardViaBackendFunction · 0.85
proxy_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected