(body []byte, upstreamModel string)
| 17 | ) |
| 18 | |
| 19 | func 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 | |
| 31 | func streaming(body []byte) bool { |
| 32 | var probe struct { |
no outgoing calls
no test coverage detected