setupFakeProxy starts a fake proxy if fakeResponses is non-empty. It configures the runtime config's ModelsGateway to point to the proxy.
(ctx context.Context, fakeResponses string, streamDelayMs int, runConfig *config.RuntimeConfig)
| 10 | // setupFakeProxy starts a fake proxy if fakeResponses is non-empty. |
| 11 | // It configures the runtime config's ModelsGateway to point to the proxy. |
| 12 | func setupFakeProxy(ctx context.Context, fakeResponses string, streamDelayMs int, runConfig *config.RuntimeConfig) (cleanup func() error, err error) { |
| 13 | proxyURL, cleanupFn, err := recording.SetupFakeProxy(ctx, fakeResponses, streamDelayMs) |
| 14 | if err != nil { |
| 15 | return nil, err |
| 16 | } |
| 17 | |
| 18 | if proxyURL != "" { |
| 19 | runConfig.ModelsGateway = proxyURL |
| 20 | } |
| 21 | |
| 22 | return cleanupFn, nil |
| 23 | } |
| 24 | |
| 25 | // setupRecordingProxy starts a recording proxy if recordPath is non-empty. |
| 26 | // It configures the runtime config's ModelsGateway to point to the proxy. |
no test coverage detected