forked from phoenix/litellm-mirror
fix(anthropic.py): deep copy messages before popping system prompt
This commit is contained in:
parent
a1784284bb
commit
86fe7a9af1
1 changed files with 2 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
import os, types
|
import os, types
|
||||||
import json
|
import json
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
import requests
|
import requests, copy
|
||||||
import time, uuid
|
import time, uuid
|
||||||
from typing import Callable, Optional
|
from typing import Callable, Optional
|
||||||
from litellm.utils import ModelResponse, Usage, map_finish_reason
|
from litellm.utils import ModelResponse, Usage, map_finish_reason
|
||||||
|
@ -117,6 +117,7 @@ def completion(
|
||||||
):
|
):
|
||||||
headers = validate_environment(api_key, headers)
|
headers = validate_environment(api_key, headers)
|
||||||
_is_function_call = False
|
_is_function_call = False
|
||||||
|
messages = copy.deepcopy(messages)
|
||||||
if model in custom_prompt_dict:
|
if model in custom_prompt_dict:
|
||||||
# check if the model has a registered custom prompt
|
# check if the model has a registered custom prompt
|
||||||
model_prompt_details = custom_prompt_dict[model]
|
model_prompt_details = custom_prompt_dict[model]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue