brainlid / langchain

Elixir implementation of a LangChain style framework.
https://hexdocs.pm/langchain/
Other
510 stars 58 forks source link

Support Bard LLM #6

Closed brainlid closed 5 months ago

brainlid commented 9 months ago

Add support for the Bard LLM.

brainlid commented 8 months ago

I've done some research and since Bard is currently considered a limited release service, there is no official released API. However, there is an unofficial Python package that reverse engineered the API but requires the user to pull the Google cookie from their browser session.

Since it's an unofficial approach and the cookie method is a dirty hack, no one should try to build a production system using it at this time.

Result: Waiting for an official API from Google.

Resources:

jadengis commented 6 months ago

@brainlid It looks like Gemini is ready to be supported. They just released API access today.

https://ai.google.dev/tutorials/rest_quickstart

michaelhakansson commented 6 months ago

@brainlid It looks like Gemini is ready to be supported. They just released API access today.

https://ai.google.dev/tutorials/rest_quickstart

And Gemini is now in LangChain: https://github.com/langchain-ai/langchain/pull/14621

brainlid commented 6 months ago

Nice!

jadengis commented 6 months ago

I'm working to add Gemini support to this library in my own fork. I'm trying to get it working today or tomorrow without streaming.

jadengis commented 6 months ago

I've got non-streamed responses, streamed responses and function calls all working in my fork. Just working on adding a few tests and will post a PR for this soon (likely tomorrow). Would love some feedback on the approach or some potential improvements.

There were some quirks getting this to work because the behavior of Google's API is slightly different.

brainlid commented 6 months ago

Very cool @jadengis! I haven't had time to look at it yet, but that's awesome.

brainlid commented 5 months ago

Closing this as we now have support for Google's API based model Gemini Pro.