From ceafdcb350ec25f73d283cedb8a53007cc13ed5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mayoral=20Vilches?= Date: Fri, 23 May 2025 14:37:23 +0000 Subject: [PATCH] Remove duplicated system prompts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: VĂ­ctor Mayoral Vilches --- .../agents/models/openai_chatcompletions.py | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/cai/sdk/agents/models/openai_chatcompletions.py b/src/cai/sdk/agents/models/openai_chatcompletions.py index 5e0701d3..25d6bca8 100644 --- a/src/cai/sdk/agents/models/openai_chatcompletions.py +++ b/src/cai/sdk/agents/models/openai_chatcompletions.py @@ -407,14 +407,15 @@ class OpenAIChatCompletionsModel(Model): msg_copy = converted_messages[idx].copy() msg_copy["cache_control"] = {"type": "ephemeral"} converted_messages[idx] = msg_copy - # --- Add to message_history: user, system, and assistant tool call messages --- - # Add system prompt to message_history - if system_instructions: - sys_msg = { - "role": "system", - "content": system_instructions - } - add_to_message_history(sys_msg) + + # # --- Add to message_history: user, system, and assistant tool call messages --- + # # Add system prompt to message_history + # if system_instructions: + # sys_msg = { + # "role": "system", + # "content": system_instructions + # } + # add_to_message_history(sys_msg) # Add user prompt(s) to message_history if isinstance(input, str): @@ -845,13 +846,14 @@ class OpenAIChatCompletionsModel(Model): msg_copy = converted_messages[idx].copy() msg_copy["cache_control"] = {"type": "ephemeral"} converted_messages[idx] = msg_copy - # --- Add to message_history: user, system prompts --- - if system_instructions: - sys_msg = { - "role": "system", - "content": system_instructions - } - add_to_message_history(sys_msg) + + # # --- Add to message_history: user, system prompts --- + # if system_instructions: + # sys_msg = { + # "role": "system", + # "content": system_instructions + # } + # add_to_message_history(sys_msg) if isinstance(input, str): user_msg = {