cheshire-cat-ai / core

Production ready AI agent framework
https://cheshirecat.ai
GNU General Public License v3.0
2.37k stars 324 forks source link

[BUG] error setting the Google Gemini Embedder #872

Closed mardif closed 3 months ago

mardif commented 4 months ago

Describe the bug Trying to set up a Google Gemini Embedder on cheshirecat, setting models/embedding-001 as value. Clicking on save, I get this error from Google:

cheshire_cat_core  | [2024-07-18 09:34:01.535] ERROR  cat.routes.embedder..upsert_embedder_setting::139
cheshire_cat_core  | GoogleGenerativeAIError('Error embedding content: 504 Deadline Exceeded')
cheshire_cat_core  | INFO:     xx.xx.xx.xx:55772 - "PUT /embedder/settings/EmbedderGeminiChatConfig HTTP/1.1" 400 Bad Request

To Reproduce Steps to reproduce the behavior (as exampple`):

  1. Startup cheshirecat
  2. Click on Settings tab and on embedder
  3. Set your personal API_KEY
  4. Set model as models/embedding-001

Expected behavior Everything should works correctly

Additional context Checking the logs, I see this error:

cheshire_cat_core  | [2024-07-18 09:34:01.535] ERROR  cat.routes.embedder..upsert_embedder_setting::139
cheshire_cat_core  | GoogleGenerativeAIError('Error embedding content: 504 Deadline Exceeded')
cheshire_cat_core  | INFO:     xx.xx.xx.xx:55772 - "PUT /embedder/settings/EmbedderGeminiChatConfig HTTP/1.1" 400 Bad Request

the problem is raised by cheshire_cat.py line 232 (version 1.6.2): embedder_size = len(self.embedder.embed_query("hello world"))

pieroit commented 3 months ago

Fixed on develop, coming with the next release :D

mardif commented 3 months ago

Thanks @pieroit