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
Refa: Update LLM stream response type to Generator (#9420)
Liu And7b4e84cda27
diff --git a/agent/component/llm.py b/agent/component/llm.pyindex 532bedc862..2d2e831bf0 100644--- a/agent/component/llm.py+++ b/agent/component/llm.py@@ -17,7 +17,7 @@ import jsonimport loggingimport osimport re-from typing import Any+from typing import Any, Generatorimport json_repairfrom copy import deepcopy@@ -154,7 +154,7 @@ class LLM(ComponentBase):return self.chat_mdl.chat(msg[0]["content"], msg[1:], self._param.gen_conf(), **kwargs)return self.chat_mdl.chat(msg[0]["content"], msg[1:], self._param.gen_conf(), images=self.imgs, **kwargs)- def _generate_streamly(self, msg:list[dict], **kwargs) -> str:+ def _generate_streamly(self, msg:list[dict], **kwargs) -> Generator[str, None, None]:ans = ""last_idx = 0endswith_think = False