- **Description:** In Google Vertex AI, Gemini Chat models currently
doesn't have a support for SystemMessage. This PR adds support for it
only if a user provides additional convert_system_message_to_human flag
during model initialization (in this case, SystemMessage would be
prepended to the first HumanMessage). **NOTE:** The implementation is
similar to #14824
- **Twitter handle:** rajesh_thallam
---------
Co-authored-by: Erick Friis <erick@langchain.dev>
"If we want to construct a simple chain that takes user specified parameters:"
"Gemini doesn't support SystemMessage at the moment, but it can be added to the first human message in the row. If you want such behavior, just set the `convert_system_message_to_human` to `True`:"
]
},
{
@ -106,7 +105,7 @@
{
"data": {
"text/plain": [
"AIMessage(content=' プログラミングが大好きです')"
"AIMessage(content=\"J'aime la programmation.\")"
]
},
"execution_count": 9,
@ -114,6 +113,40 @@
"output_type": "execute_result"
}
],
"source": [
"system = \"You are a helpful assistant who translate English to French\"\n",
"human = \"Translate this sentence from English to French. I love programming.\"\n",