fix: message list order (#3987)
Fix message list order The system message should be inserted into the first position of the message list instead of being appended at the last position.
This commit is contained in:
parent
4221fa40e6
commit
0fc4c4781e
1 changed files with 1 additions and 1 deletions
|
|
@ -166,7 +166,7 @@ class LCModelComponent(Component):
|
|||
messages.append(HumanMessage(content=input_value))
|
||||
|
||||
if system_message and not system_message_added:
|
||||
messages.append(SystemMessage(content=system_message))
|
||||
messages.insert(0, SystemMessage(content=system_message))
|
||||
inputs: list | dict = messages or {}
|
||||
try:
|
||||
if self.output_parser is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue