Skip to content

Commit

Permalink
fix: [Gemini] preserved custom_content of the 2nd message when 1st is…
Browse files Browse the repository at this point in the history
… a system (#121)
  • Loading branch information
adubovik authored Sep 6, 2024
1 parent 5b4ee19 commit f60c185
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions aidial_adapter_vertexai/chat/gemini/prompt/gemini_1_0_pro.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,7 @@ def accommodate_first_system_message(messages: List[Message]) -> List[Message]:
if first_message.content is None or second_message.content is None:
return messages

content = first_message.content + "\n" + second_message.content
return [Message(role=Role.USER, content=content)] + messages[2:]
new_message = second_message.copy()
new_message.content = first_message.content + "\n" + second_message.content

return [new_message] + messages[2:]

0 comments on commit f60c185

Please sign in to comment.