generative-ai icon indicating copy to clipboard operation
generative-ai copied to clipboard

Correct usage of systemInstruction

Open Setmaster opened this issue 8 months ago • 1 comments

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

Setmaster avatar Jun 23 '24 20:06 Setmaster