Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Rafe: Update LLMService type hints (#9131)

Liu Ane9c5c7bc7cd4
diff --git a/api/db/services/llm_service.py b/api/db/services/llm_service.py
index 258a4bf92c..d669cdd900 100644
--- a/api/db/services/llm_service.py
+++ b/api/db/services/llm_service.py
@@ -16,6 +16,7 @@
import logging
import re
from functools import partial
+from typing import Generator
from langfuse import Langfuse
@@ -57,7 +58,6 @@ class TenantLLMService(CommonService):
mdlnm += "___OpenAI-API"
elif fid == "VLLM":
mdlnm += "___VLLM"
-
objs = cls.query(tenant_id=tenant_id, llm_name=mdlnm, llm_factory=fid)
if not objs:
return
@@ -334,7 +334,7 @@ class LLMBundle:
return txt
- def tts(self, text: str) -> None:
+ def tts(self, text: str) -> Generator[bytes, None, None]:
if self.langfuse:
span = self.trace.span(name="tts", input={"text": text})