mirror of
https://github.com/kennethreitz/instructor.git
synced 2026-06-05 22:50:18 +00:00
fix: json modes - don't add json schema again in system message (#435)
This commit is contained in:
+2
-3
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user