mirror of
https://github.com/vxcontrol/langchaingo.git
synced 2026-08-24 21:31:28 -04:00
c544fb77bd
* 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
26 lines
552 B
Go
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
|
|
}
|
|
}
|