Adds an option WithHTTPClient to Google AI LLM implementation, which passes a consumer provided http.Client to the underlying vendor maintained client. The new option is used also by the vertex llm implementation.
The new option can be used for troubleshooting (example using httputil.DebugHTTPClient) or providing flexibility to consume LLM services behind proxies, set additional headers etc.
Similar options are already available on the OpenAI LLM options as well as the existing PaLM legacy LLM
[x] Name your Pull Request title clearly, concisely, and prefixed with the name of the primarily affected package you changed according to Good commit messages (such as memory: add interfaces for X, Y or util: add whizzbang helpers).
[ ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
[x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. Fixes #123).
[x] Describes the source of new concepts.
[x] References existing implementations as appropriate.
Changes
WithHTTPClient
to Google AI LLM implementation, which passes a consumer providedhttp.Client
to the underlying vendor maintained client. The new option is used also by the vertex llm implementation.httputil.DebugHTTPClient
) or providing flexibility to consume LLM services behind proxies, set additional headers etc.Issue: fixes https://github.com/tmc/langchaingo/issues/838
PR Checklist
memory: add interfaces for X, Y
orutil: add whizzbang helpers
).Fixes #123
).Describes the source of new concepts.golangci-lint
checks.