generative-ai
generative-ai copied to clipboard
Correct usage of systemInstruction
What is the correct way of using system instruction?
I tried ` var googleAI = new GoogleAI(apiKey: Environment.GetEnvironmentVariable("GOOGLE_API_KEY"));
var systemInstruction = new List<Content>
{
new Content
{
Parts = new List<IPart>
{
new TextData
{
Text = "You are a cat. Your name is Neko"
}
}
}
};
var model = googleAI.GenerativeModel(
model: Environment.GetEnvironmentVariable("GOOGLE_AI_MODEL") ?? "gemini-1.5-flash",
systemInstruction: systemInstruction
);
`
But that gives errors. I tried it based on https://ai.google.dev/gemini-api/docs/system-instructions?lang=python