mirror of https://github.com/langgenius/dify.git
r2 transform
This commit is contained in:
parent
675ff9bd7d
commit
c660c98b04
|
|
@ -30,8 +30,8 @@ class RerankingModelConfig(BaseModel):
|
|||
Reranking Model Config.
|
||||
"""
|
||||
|
||||
reranking_provider_name: str
|
||||
reranking_model_name: str
|
||||
reranking_provider_name: Optional[str] = ""
|
||||
reranking_model_name: Optional[str] = ""
|
||||
|
||||
|
||||
class VectorSetting(BaseModel):
|
||||
|
|
@ -57,8 +57,8 @@ class WeightedScoreConfig(BaseModel):
|
|||
Weighted score Config.
|
||||
"""
|
||||
|
||||
vector_setting: VectorSetting
|
||||
keyword_setting: KeywordSetting
|
||||
vector_setting: Optional[VectorSetting]
|
||||
keyword_setting: Optional[KeywordSetting]
|
||||
|
||||
|
||||
class EmbeddingSetting(BaseModel):
|
||||
|
|
|
|||
|
|
@ -136,8 +136,8 @@ class RagPipelineTransformService:
|
|||
def _deal_knowledge_index(
|
||||
self, dataset: Dataset, doc_form: str, indexing_technique: str, retrieval_model: dict, node: dict
|
||||
):
|
||||
knowledge_configuration = node.get("data", {})
|
||||
knowledge_configuration = KnowledgeConfiguration(**knowledge_configuration)
|
||||
knowledge_configuration_dict = node.get("data", {})
|
||||
knowledge_configuration = KnowledgeConfiguration(**knowledge_configuration_dict)
|
||||
|
||||
if indexing_technique == "high_quality":
|
||||
knowledge_configuration.embedding_model = dataset.embedding_model
|
||||
|
|
@ -150,7 +150,9 @@ class RagPipelineTransformService:
|
|||
else:
|
||||
dataset.retrieval_model = knowledge_configuration.retrieval_model.model_dump()
|
||||
|
||||
return knowledge_configuration.model_dump()
|
||||
knowledge_configuration_dict.update(knowledge_configuration.model_dump())
|
||||
node["data"] = knowledge_configuration_dict
|
||||
return node
|
||||
|
||||
def _create_pipeline(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Reference in New Issue