langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
92.27k stars 14.73k forks source link

Google Gemini #14671

Closed ktibbs9417 closed 9 months ago

ktibbs9417 commented 9 months ago

Feature request

With Gemini Pro going GA today (Dec. 13th). When can users of LangChain expect an update to use the new LLM?

Motivation

This will allow users of LangChain to use the latest LLM that Google is providing along with their safety settings.

Your contribution

I can try and help. Happy to contribute where needed

dosubot[bot] commented 9 months ago

🤖

That's great to hear that you're interested in contributing to LangChain! Your willingness to help is much appreciated. If you're able to work on integrating the new LLM from Google Gemini into LangChain, that would be a valuable contribution to the project. Thank you for your support!


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

jamesbraza commented 9 months ago

@ktibbs9417 check this: https://github.com/langchain-ai/langchain/pull/14621

You can run pip install langchain-google-genai to get started with this, note it was just added about 15 mins after you made this issue haha

baskaryan commented 9 months ago

Like @jamesbraza said, should be able to do this with langchain-google-genai. Let us know if you see any issues! Closing GH issue for now

dheerajiiitv commented 9 months ago

You can also use ChatVertexAI with model_name gemini-pro

gpy1234 commented 9 months ago

@dheerajiiitv Did you try it with ChatVertexAI? I tried to use it with ConversationalRetrievalChain.from_llm, but it's not working.

dheerajiiitv commented 9 months ago

No, I am using System message. I can't use ChatVertexAi, you have to use VertexAI

On Sat, Dec 16, 2023, 4:48 PM gpy1234 @.***> wrote:

@dheerajiiitv https://github.com/dheerajiiitv Did you try it with ChatVertexAI? I tried to use it with ConversationalRetrievalChain.from_llm, but it's not working.

— Reply to this email directly, view it on GitHub https://github.com/langchain-ai/langchain/issues/14671#issuecomment-1858793110, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFY7PMHXXFGG2CE7VW537WDYJV7PZAVCNFSM6AAAAABATU7VH6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJYG44TGMJRGA . You are receiving this because you were mentioned.Message ID: @.***>

JoAmps commented 8 months ago

You can also use ChatVertexAI with model_name gemini-pro

I tried it, but it doesnt stream when incorporated into retrieval chain, it has streaming in its parameters but it doesnt stream, does it stream for you?

pseudotensor commented 7 months ago

@JoAmps Seems still that way ever since the langchain google package was updated. It got better for exception handling, but lost streaming once went to:

langchain-google-genai==0.0.6
google-generativeai==0.3.2
pseudotensor commented 7 months ago

https://github.com/langchain-ai/langchain/pull/15459

https://github.com/h2oai/h2ogpt/commit/972d0b69813343290e219302e25f955bf482105c

dharless-eli-lilly commented 4 weeks ago

I'm confused because I see most things related to this are closed, but not merged. What's the recommended route here? Should we abandon LLMChain since it's marked deprecated and use the new notation? Langchain is all pretty new to me so would love a little bit of clear direction.