Fix linting

This commit is contained in:
yangdx 2025-07-23 16:16:37 +08:00
parent 00d7bc80bf
commit 7d96ca98f7

View File

@ -2048,9 +2048,7 @@ async def _build_query_context(
max_total_tokens = getattr( max_total_tokens = getattr(
query_param, query_param,
"max_total_tokens", "max_total_tokens",
text_chunks_db.global_config.get( text_chunks_db.global_config.get("max_total_tokens", DEFAULT_MAX_TOTAL_TOKENS),
"max_total_tokens", DEFAULT_MAX_TOTAL_TOKENS
),
) )
# Truncate entities based on complete JSON serialization # Truncate entities based on complete JSON serialization
@ -2060,9 +2058,7 @@ async def _build_query_context(
# Process entities context to replace GRAPH_FIELD_SEP with : in file_path fields # Process entities context to replace GRAPH_FIELD_SEP with : in file_path fields
for entity in entities_context: for entity in entities_context:
if "file_path" in entity and entity["file_path"]: if "file_path" in entity and entity["file_path"]:
entity["file_path"] = entity["file_path"].replace( entity["file_path"] = entity["file_path"].replace(GRAPH_FIELD_SEP, ";")
GRAPH_FIELD_SEP, ";"
)
entities_context = truncate_list_by_token_size( entities_context = truncate_list_by_token_size(
entities_context, entities_context,