fix: native function calling system prompt duplication
This commit is contained in:
@@ -1256,6 +1256,7 @@ async def generate_chat_completion(
|
||||
url_idx: Optional[int] = None,
|
||||
user=Depends(get_verified_user),
|
||||
bypass_filter: Optional[bool] = False,
|
||||
bypass_system_prompt: bool = False,
|
||||
db: Session = Depends(get_session),
|
||||
):
|
||||
if BYPASS_MODEL_ACCESS_CONTROL:
|
||||
@@ -1295,7 +1296,8 @@ async def generate_chat_completion(
|
||||
system = params.pop("system", None)
|
||||
|
||||
payload = apply_model_params_to_body_ollama(params, payload)
|
||||
payload = apply_system_prompt_to_body(system, payload, metadata, user)
|
||||
if not bypass_system_prompt:
|
||||
payload = apply_system_prompt_to_body(system, payload, metadata, user)
|
||||
|
||||
# Check if user has access to the model
|
||||
if not bypass_filter and user.role == "user":
|
||||
|
||||
@@ -800,6 +800,7 @@ async def generate_chat_completion(
|
||||
form_data: dict,
|
||||
user=Depends(get_verified_user),
|
||||
bypass_filter: Optional[bool] = False,
|
||||
bypass_system_prompt: bool = False,
|
||||
db: Session = Depends(get_session),
|
||||
):
|
||||
if BYPASS_MODEL_ACCESS_CONTROL:
|
||||
@@ -830,7 +831,8 @@ async def generate_chat_completion(
|
||||
system = params.pop("system", None)
|
||||
|
||||
payload = apply_model_params_to_body_openai(params, payload)
|
||||
payload = apply_system_prompt_to_body(system, payload, metadata, user)
|
||||
if not bypass_system_prompt:
|
||||
payload = apply_system_prompt_to_body(system, payload, metadata, user)
|
||||
|
||||
# Check if user has access to the model
|
||||
if not bypass_filter and user.role == "user":
|
||||
|
||||
Reference in New Issue
Block a user