mirror of https://github.com/aliasrobotics/cai.git
Remove duplicated system prompts
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
This commit is contained in:
parent
8de5d7922b
commit
ceafdcb350
|
|
@ -407,14 +407,15 @@ class OpenAIChatCompletionsModel(Model):
|
||||||
msg_copy = converted_messages[idx].copy()
|
msg_copy = converted_messages[idx].copy()
|
||||||
msg_copy["cache_control"] = {"type": "ephemeral"}
|
msg_copy["cache_control"] = {"type": "ephemeral"}
|
||||||
converted_messages[idx] = msg_copy
|
converted_messages[idx] = msg_copy
|
||||||
# --- Add to message_history: user, system, and assistant tool call messages ---
|
|
||||||
# Add system prompt to message_history
|
# # --- Add to message_history: user, system, and assistant tool call messages ---
|
||||||
if system_instructions:
|
# # Add system prompt to message_history
|
||||||
sys_msg = {
|
# if system_instructions:
|
||||||
"role": "system",
|
# sys_msg = {
|
||||||
"content": system_instructions
|
# "role": "system",
|
||||||
}
|
# "content": system_instructions
|
||||||
add_to_message_history(sys_msg)
|
# }
|
||||||
|
# add_to_message_history(sys_msg)
|
||||||
|
|
||||||
# Add user prompt(s) to message_history
|
# Add user prompt(s) to message_history
|
||||||
if isinstance(input, str):
|
if isinstance(input, str):
|
||||||
|
|
@ -845,13 +846,14 @@ class OpenAIChatCompletionsModel(Model):
|
||||||
msg_copy = converted_messages[idx].copy()
|
msg_copy = converted_messages[idx].copy()
|
||||||
msg_copy["cache_control"] = {"type": "ephemeral"}
|
msg_copy["cache_control"] = {"type": "ephemeral"}
|
||||||
converted_messages[idx] = msg_copy
|
converted_messages[idx] = msg_copy
|
||||||
# --- Add to message_history: user, system prompts ---
|
|
||||||
if system_instructions:
|
# # --- Add to message_history: user, system prompts ---
|
||||||
sys_msg = {
|
# if system_instructions:
|
||||||
"role": "system",
|
# sys_msg = {
|
||||||
"content": system_instructions
|
# "role": "system",
|
||||||
}
|
# "content": system_instructions
|
||||||
add_to_message_history(sys_msg)
|
# }
|
||||||
|
# add_to_message_history(sys_msg)
|
||||||
|
|
||||||
if isinstance(input, str):
|
if isinstance(input, str):
|
||||||
user_msg = {
|
user_msg = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue