Files
langchaingo/tools/serpapi/options.go
T
Travis Cline c544fb77bd all: add broad httprr coverage, update dependencies, organize go.mod file, bump to 1.23 (#1299)
* all: add broad httprr coverage, update dependencies, organize go.mod file, bump to 1.23

update go version to 1.23
add lots of test coverage via httprr recordings
update dependencies and organize go.mod
add testutil/testctr which helps work around a testcontainers-go+colima bug
expand the huggingface implementation and tests
expand capabilities of the ollama package
2025-06-04 11:41:45 -07:00

26 lines
552 B
Go

package serpapi
import "net/http"
type options struct {
apiKey string
httpClient *http.Client
}
type Option func(*options)
// WithAPIKey passes the Serpapi API token to the client. If not set, the token
// is read from the SERPAPI_API_KEY environment variable.
func WithAPIKey(apiKey string) Option {
return func(opts *options) {
opts.apiKey = apiKey
}
}
// WithHTTPClient sets a custom HTTP client for the SerpAPI requests.
func WithHTTPClient(client *http.Client) Option {
return func(opts *options) {
opts.httpClient = client
}
}