fix: json modes - don't add json schema again in system message (#435)

This commit is contained in:
teome
2024-02-13 19:58:28 +00:00
committed by GitHub
parent 504c15374e
commit 6d72c7885c
+2 -3
View File
@@ -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}")