recording

package
v1.36.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL