Fix linting

This commit is contained in:
yangdx
2025-05-08 04:29:43 +08:00
parent 45d4db1eff
commit 10dbbe4ebf
2 changed files with 11 additions and 3 deletions

View File

@@ -93,7 +93,7 @@ class QueryParam:
This allows using different models for different query modes.
"""
user_prompt: str | None= None
user_prompt: str | None = None
"""User-provided prompt for the query.
If proivded, this will be use instead of the default vaulue from prompt template.
"""

View File

@@ -926,7 +926,11 @@ async def kg_query(
)
# Build system prompt
user_prompt = query_param.user_prompt if query_param.user_prompt else PROMPTS["DEFAULT_USER_PROMPT"]
user_prompt = (
query_param.user_prompt
if query_param.user_prompt
else PROMPTS["DEFAULT_USER_PROMPT"]
)
sys_prompt_temp = system_prompt if system_prompt else PROMPTS["rag_response"]
sys_prompt = sys_prompt_temp.format(
context_data=context,
@@ -1911,7 +1915,11 @@ async def naive_query(
)
# Build system prompt
user_prompt = query_param.user_prompt if query_param.user_prompt else PROMPTS["DEFAULT_USER_PROMPT"]
user_prompt = (
query_param.user_prompt
if query_param.user_prompt
else PROMPTS["DEFAULT_USER_PROMPT"]
)
sys_prompt_temp = system_prompt if system_prompt else PROMPTS["naive_rag_response"]
sys_prompt = sys_prompt_temp.format(
content_data=text_units_str,