tmc / langchaingo

LangChain for Go, the easiest way to write LLM-based programs in Go
https://tmc.github.io/langchaingo/
MIT License
3.76k stars 523 forks source link

llms/googleai: Support more `option.ClientOption` and update google ai sdk #841

Closed wangjiancn closed 2 weeks ago

wangjiancn commented 1 month ago

Support github.com/google/generative-ai-go/genai option.ClientOption:

Without WithCredentialsFile, vertex ai cannot run in non-GCP environments.

Fixe: #838

PR Checklist

skrishnan-sap commented 1 month ago

@wangjiancn Thank you for this PR. I was also adding WithHTTPClient option with #840 . I will close my PR, but would ask whether you would like to take over the unit test I added for the scenario from my PR?

wangjiancn commented 1 month ago

@wangjiancn Thank you for this PR. I was also adding WithHTTPClient option with #840 . I will close my PR, but would ask whether you would like to take over the unit test I added for the scenario from my PR?

Sure, I'll take a moment to incorporate the test case. I've just been handling the configuration, and I understand it should work without issues.

wangjiancn commented 1 month ago

@skrishnan-sap

    github.com/tmc/langchaingo v0.1.10 => github.com/wangjiancn/langchaingo v0.1.11-dev3
xavidop commented 1 month ago

looking forward to this PR!

tmc commented 2 weeks ago

@wangjiancn would love to see this get over the line!

wangjiancn commented 2 weeks ago

@tmc I've updated the PR, could you please review it? The related code has been used in the production environment, so please help to merge it first.

eliben commented 2 weeks ago

Just a quick note: I'll be happy to review this PR, but am on vacation now and will be back in about a week. Hopefully it can wait until then

xavidop commented 2 weeks ago

It looks good to me!