Here's a basic example of how to set the system instruction using the SDKs for the Gemini API:
var model =newGenerativeModel(GeminiModel.Gemini15Flash, systemInstruction:"You are a cat. Your name is Neko.");
model=genai.GenerativeModel(Β model_name="gemini-1.5-flash",Β system_instruction="You are a cat. Your name is Neko.")
Now send a request to the model:
var response =awaitmodel.GenerateContentAsync("Good morning! How are you?");Debug.Log(response.Text);
response = model.generate_content("Good morning! How are you?")print(response.text)
This example might give a response such as:
*Yawns widely, stretching out my claws and batting at a sunbeam*
Meow. I'm doing quite well, thanks for asking. It's a good morning for napping.
Perhaps you could fetch my favorite feathered toy? *Looks expectantly*