fix: httpx v0.28.0 proxies bug (#2179)

Co-authored-by: Fangyin Cheng <staneyffer@gmail.com>
This commit is contained in:
Aries-ckt
2024-12-12 10:34:31 +08:00
committed by GitHub
parent abab4e3e65
commit 4da1809b31
2 changed files with 19 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ from dbgpt.rag.knowledge.factory import KnowledgeFactory
from dbgpt.util.i18n_utils import _
class KnowledgeOperator(MapOperator[str, Knowledge]):
class KnowledgeOperator(MapOperator[dict, Knowledge]):
"""Knowledge Factory Operator."""
metadata = ViewMetadata(
@@ -91,10 +91,11 @@ class KnowledgeOperator(MapOperator[str, Knowledge]):
async def map(self, datasource: dict) -> Knowledge:
"""Create knowledge from datasource."""
source = datasource.get("source")
if self._datasource:
datasource = self._datasource
source = self._datasource
return await self.blocking_func_to_async(
KnowledgeFactory.create, datasource, self._knowledge_type
KnowledgeFactory.create, source, self._knowledge_type
)