Documentation
¶
Overview ¶
Package recording provides helpers for recording and replaying AI API interactions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupFakeProxy ¶
func SetupFakeProxy(fakeResponses string, streamDelayMs int) (proxyURL string, cleanup func() error, err error)
SetupFakeProxy starts a fake proxy if fakeResponses is non-empty. streamDelayMs controls simulated streaming: 0 = disabled, >0 = delay in milliseconds between chunks. It returns the proxy URL and a cleanup function that must be called when done (typically via defer).
func SetupRecordingProxy ¶
func SetupRecordingProxy(recordPath string) (cassettePath, proxyURL string, cleanup func() error, err error)
SetupRecordingProxy starts a recording proxy if recordPath is non-empty. It handles auto-generating a filename when recordPath is "true" (from NoOptDefVal), and normalizes the path by stripping any .yaml suffix. Returns the cassette path (with .yaml extension), the proxy URL, and a cleanup function. The cleanup function must be called when done (typically via defer).
Types ¶
This section is empty.