palladius / gemini-news-crawler

A GenAI news crawler in Ruby leveraging Gemini multimodality ability
MIT License
13 stars 1 forks source link

PalmLLM.summarize is obsoleted #5

Open palladius opened 1 week ago

palladius commented 1 week ago
$ rails c
> PalmLLM.summarize text: 'ciao'
=> 
#<Langchain::LLM::GooglePalmResponse:0x00007f1de09b21e8
 @model="text-bison-001",
 @prompt_tokens=nil,
 @raw_response=
  {"error"=>
    {"code"=>404,
     "message"=>"Requested entity was not found.",
     "status"=>"NOT_FOUND",
     "details"=>
      [{"@type"=>"type.googleapis.com/google.rpc.DebugInfo", "detail"=>"[ORIGINAL ERROR] generic::not_found: The GenerateText method has been deprecated. Please try GenerateContent method which uses the Gemini model."}]}}>
irb(main):005> 

Note i use this only for a small piece of the demo, could be the right time i REMOVE PalmLLM (=> nil) and use gemini1.5 instead.

palladius commented 1 week ago

Trying the lazy way, its bigger brothers, both fail:

irb(main):002> GeminiLLM.summarize text: 'ciao'
🐒🐒🐒 Monkeypatching GoogleGemini::neha_authenticate(): Cache HIT! 🐒🐒🐒
config/initializers/riccardo02_monkeypatch_langchain_google_gemini.rb:125:in `complete': undefined method `generate_text' for nil:NilClass (NoMethodError)

        response = client.generate_text(**default_params)
                         ^^^^^^^^^^^^^^
        from config/initializers/riccardo02_monkeypatch_langchain_google_gemini.rb:97:in `summarize'
        from (irb):2:in `<main>'
irb(main):003> VertexLLM.summarize text: 'ciao'
config/initializers/riccardo03_monkeypatch_langchain_google_vertex_ai.rb:151:in `complete': undefined method `generate_text' for nil:NilClass (NoMethodError)

        response = client.generate_text(**default_params)
                         ^^^^^^^^^^^^^^
        from config/initializers/riccardo03_monkeypatch_langchain_google_vertex_ai.rb:166:in `summarize'
        from (irb):3:in `<main>'
irb(main):004>