Fix formatting issues

This commit is contained in:
Shabana Baig 2025-10-15 10:00:55 -04:00
parent 41c55fac06
commit 70bfe622cd
2 changed files with 6 additions and 4 deletions

View file

@ -127,9 +127,11 @@ class OpenAIResponsesImpl:
# the instructions used on previous turns will not be carried over in the context # the instructions used on previous turns will not be carried over in the context
previous_instructions = previous_response.instructions previous_instructions = previous_response.instructions
if previous_instructions: if previous_instructions:
if (isinstance(previous_instructions, str) and if (
previous_instructions == messages[0].content and isinstance(previous_instructions, str)
messages[0].role == "system"): and previous_instructions == messages[0].content
and messages[0].role == "system"
):
# Omit instructions from previous response # Omit instructions from previous response
del messages[0] del messages[0]
else: else:

View file

@ -844,7 +844,7 @@ async def test_create_openai_response_with_previous_response_instructions(
OpenAIUserMessageParam(content="Name some towns in Ireland"), OpenAIUserMessageParam(content="Name some towns in Ireland"),
OpenAIAssistantMessageParam(content="Galway, Longford, Sligo"), OpenAIAssistantMessageParam(content="Galway, Longford, Sligo"),
], ],
instructions="You are a helpful assistant." instructions="You are a helpful assistant.",
) )
mock_responses_store.get_response_object.return_value = response mock_responses_store.get_response_object.return_value = response