fix: Fix potential mutable default parameter issue

This commit is contained in:
yangdx
2025-02-06 14:46:07 +08:00
parent a49ee2ce71
commit eb5f57e989
2 changed files with 21 additions and 7 deletions

View File

@@ -752,10 +752,12 @@ def create_app(args):
async def openai_alike_model_complete(
prompt,
system_prompt=None,
history_messages=[],
history_messages=None,
keyword_extraction=False,
**kwargs,
) -> str:
if history_messages is None:
history_messages = []
return await openai_complete_if_cache(
args.llm_model,
prompt,
@@ -769,10 +771,12 @@ def create_app(args):
async def azure_openai_model_complete(
prompt,
system_prompt=None,
history_messages=[],
history_messages=None,
keyword_extraction=False,
**kwargs,
) -> str:
if history_messages is None:
history_messages = []
return await azure_openai_complete_if_cache(
args.llm_model,
prompt,