Resolve merge conflicts

This commit is contained in:
Shabana Baig 2025-10-15 17:57:07 -04:00
parent 70bfe622cd
commit f4556f14c7
2 changed files with 0 additions and 15 deletions

View file

@ -123,19 +123,6 @@ class OpenAIResponsesImpl:
# Use stored messages directly and convert only new input
message_adapter = TypeAdapter(list[OpenAIMessageParam])
messages = message_adapter.validate_python(previous_response.messages)
# When managing conversation state with the previous_response_id parameter,
# the instructions used on previous turns will not be carried over in the context
previous_instructions = previous_response.instructions
if previous_instructions:
if (
isinstance(previous_instructions, str)
and previous_instructions == messages[0].content
and messages[0].role == "system"
):
# Omit instructions from previous response
del messages[0]
else:
raise ValueError("Instructions from the previous response could not be validated")
new_messages = await convert_response_input_to_chat_messages(input, previous_messages=messages)
messages.extend(new_messages)
else: