RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Fix: Gemini parameters error (#9520)
Yongteng Leife32952825a9
diff --git a/conf/llm_factories.json b/conf/llm_factories.jsonindex 78f100130c..072185a9cd 100644--- a/conf/llm_factories.json+++ b/conf/llm_factories.json@@ -1146,62 +1146,37 @@"llm_name": "gemini-2.5-flash","tags": "LLM,CHAT,1024K,IMAGE2TEXT","max_tokens": 1048576,- "model_type": "image2text",+ "model_type": "chat","is_tools": true},{"llm_name": "gemini-2.5-pro","tags": "LLM,CHAT,IMAGE2TEXT,1024K","max_tokens": 1048576,- "model_type": "image2text",+ "model_type": "chat","is_tools": true},{- "llm_name": "gemini-2.5-flash-preview-05-20",+ "llm_name": "gemini-2.5-flash-lite","tags": "LLM,CHAT,1024K,IMAGE2TEXT","max_tokens": 1048576,- "model_type": "image2text",+ "model_type": "chat","is_tools": true},{- "llm_name": "gemini-2.0-flash-001",+ "llm_name": "gemini-2.0-flash","tags": "LLM,CHAT,1024K","max_tokens": 1048576,- "model_type": "image2text",+ "model_type": "chat","is_tools": true},{- "llm_name": "gemini-2.0-flash-thinking-exp-01-21",+ "llm_name": "gemini-2.0-flash-lite","tags": "LLM,CHAT,1024K","max_tokens": 1048576,"model_type": "chat","is_tools": true},- {- "llm_name": "gemini-1.5-flash",- "tags": "LLM,IMAGE2TEXT,1024K",- "max_tokens": 1048576,- "model_type": "image2text"- },- {- "llm_name": "gemini-2.5-pro-preview-05-06",- "tags": "LLM,IMAGE2TEXT,1024K",- "max_tokens": 1048576,- "model_type": "image2text"- },- {- "llm_name": "gemini-1.5-pro",- "tags": "LLM,IMAGE2TEXT,2048K",- "max_tokens": 2097152,- "model_type": "image2text"- },- {- "llm_name": "gemini-1.5-flash-8b",- "tags": "LLM,IMAGE2TEXT,1024K",- "max_tokens": 1048576,- "model_type": "image2text",- "is_tools": true- },{"llm_name": "text-embedding-004","tags": "TEXT EMBEDDING",diff --git a/rag/llm/cv_model.py b/rag/llm/cv_model.pyindex a04ded780c..4ca4ee190d 100644--- a/rag/llm/cv_model.py+++ b/rag/llm/cv_model.py@@ -539,24 +539,24 @@ class GeminiCV(Base):return res.text, res.usage_metadata.total_token_countdef chat(self, system, history, gen_conf, images=[]):- from transformers import GenerationConfig+ generation_config = dict(temperature=gen_conf.get("temperature", 0.3), top_p=gen_conf.get("top_p", 0.7))try:response = self.model.generate_content(self._form_history(system, history, images),- generation_config=GenerationConfig(temperature=gen_conf.get("temperature", 0.3), top_p=gen_conf.get("top_p", 0.7)))+ generation_config=generation_config)ans = response.textreturn ans, response.usage_metadata.total_token_countexcept Exception as e:return "**ERROR**: " + str(e), 0def chat_streamly(self, system, history, gen_conf, images=[]):- from transformers import GenerationConfigans = ""response = Nonetry:+ generation_config = dict(temperature=gen_conf.get("temperature", 0.3), top_p=gen_conf.get("top_p", 0.7))response = self.model.generate_content(self._form_history(system, history, images),- generation_config=GenerationConfig(temperature=gen_conf.get("temperature", 0.3), top_p=gen_conf.get("top_p", 0.7)),+ generation_config=generation_config,stream=True,)@@ -572,7 +572,7 @@ class GeminiCV(Base):yield response.usage_metadata.total_token_countelse:yield 0-+class NvidiaCV(Base):_FACTORY_NAME = "NVIDIA"