langchain-ai / langchain-google

MIT License
76 stars 79 forks source link

Using system_instruction with VertexAI (Gemini models) #242

Open ymansar opened 1 month ago

ymansar commented 1 month ago

Hello !

I'm trying to use system instructions when calling the LLM through VertexAI, but I'm encountering issues. I've seen that support for this parameter was added to ChatVertexAI, but I couldn't find an equivalent for standard Vertex AI.

Is there a way to use system instructions with the VertexAI LLM?

Thanks!

lkuligin commented 1 month ago

Have you considered using ChatVertexAI instead?

ymansar commented 1 month ago

I liked VertexAI more because it has a simpler API and is enough for my needs. If ChatVertexAI is the only way to use system_instruction then I'll probably just switch like you said. Still, would you be Open to a PR to add this same feature to VertexAI ?

Thanks

lkuligin commented 1 month ago

Sure, it would be great if you'd work on it. But, please, do it in line with PR (i.e., switch to the native gapic client): https://github.com/langchain-ai/langchain-google/pull/213