Closed alchaplinsky closed 1 year ago
@alchaplinsky Works for me. Is your GOOGLE_PALM_API_KEY
set?
@andreibondarev Sure. Did you try on the most recent version or the main branch? It fails for me in main
.
@alchaplinsky On main
-> langchain [main*]: bin/console
irb(main):001:0> llm = Langchain::LLM::GooglePalm.new api_key: ENV['GOOGLE_PALM_API_KEY']
=> #<Langchain::LLM::GooglePalm:0x00007fa2b5182e78 @client=#<GooglePalmApi::Client:0x00007fa2b5178b58 @api_key="AIzaSyBRzMe0CRTkgIYctVPTy9eepY2f1z8FDtk">, @defaults={:temperature=>0.0, :dimension=>768, :completion_model_name=>"text-bison-...
irb(main):002:0>
irb(main):003:0> convo = Langchain::Conversation.new llm: llm
=> #<Langchain::Conversation:0x00007fa2e530d218 @llm=#<Langchain::LLM::GooglePalm:0x00007fa2b5182e78 @client=#<GooglePalmApi::Client:0x00007fa2b5178b58 @api_key="AIzaSyBRzMe0CRTkgIYctVPTy9eepY2f1z8FDtk">, @defaults={:temperature=>0.0, :di...
irb(main):004:0> convo.message 'Hello'
=> "Hello! How can I help you today?"
This was happening due to API error because PaLM2 API can not be called from outside of the US atm.
Problem with PaLM model token length validation while sending a message through
Conversation
.to reproduce:
Result: