mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-26 17:16:52 +08:00
Fix: type check for chunks (#12164)
### What problem does this PR solve? Fix: type check for chunks ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -411,8 +411,6 @@ class KnowledgebaseService(CommonService):
|
|||||||
ok, _t = TenantService.get_by_id(tenant_id)
|
ok, _t = TenantService.get_by_id(tenant_id)
|
||||||
if not ok:
|
if not ok:
|
||||||
return False, get_data_error_result(message="Tenant not found.")
|
return False, get_data_error_result(message="Tenant not found.")
|
||||||
if kwargs.get("parser_config") and isinstance(kwargs["parser_config"], dict) and not kwargs["parser_config"].get("llm_id"):
|
|
||||||
kwargs["parser_config"]["llm_id"] = _t.llm_id
|
|
||||||
|
|
||||||
# Build payload
|
# Build payload
|
||||||
kb_id = get_uuid()
|
kb_id = get_uuid()
|
||||||
@ -427,6 +425,7 @@ class KnowledgebaseService(CommonService):
|
|||||||
|
|
||||||
# Update parser_config (always override with validated default/merged config)
|
# Update parser_config (always override with validated default/merged config)
|
||||||
payload["parser_config"] = get_parser_config(parser_id, kwargs.get("parser_config"))
|
payload["parser_config"] = get_parser_config(parser_id, kwargs.get("parser_config"))
|
||||||
|
payload["parser_config"]["llm_id"] = _t.llm_id
|
||||||
|
|
||||||
return True, payload
|
return True, payload
|
||||||
|
|
||||||
|
|||||||
@ -105,6 +105,9 @@ class Tokenizer(ProcessBase):
|
|||||||
|
|
||||||
async def _invoke(self, **kwargs):
|
async def _invoke(self, **kwargs):
|
||||||
try:
|
try:
|
||||||
|
chunks = kwargs.get("chunks")
|
||||||
|
kwargs["chunks"] = [c for c in chunks if c is not None]
|
||||||
|
|
||||||
from_upstream = TokenizerFromUpstream.model_validate(kwargs)
|
from_upstream = TokenizerFromUpstream.model_validate(kwargs)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.set_output("_ERROR", f"Input error: {str(e)}")
|
self.set_output("_ERROR", f"Input error: {str(e)}")
|
||||||
|
|||||||
Reference in New Issue
Block a user