diff --git a/instructor/patch.py b/instructor/patch.py index 29c8a1e..e5adde1 100644 --- a/instructor/patch.py +++ b/instructor/patch.py @@ -159,9 +159,8 @@ def handle_response_model( "content": message, }, ) - - # if the first message is a system append the schema to the end - if new_kwargs["messages"][0]["role"] == "system": + # if it is, system append the schema to the end + else: new_kwargs["messages"][0]["content"] += f"\n\n{message}" else: raise ValueError(f"Invalid patch mode: {mode}")