Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
Stay organized with collections
Save and categorize content based on your preferences.
This document describes how to use system instructions. To learn about what
system instructions are and best practices for using system instructions, see
Introduction to system instructions
instead.
System instructions are a set of instructions that the model processes before it
processes prompts. We recommend that you use system instructions to tell the
model how you want it to behave and respond to prompts. For example, you can
include things like the role or persona, contextual information, and formatting
instructions:
You are a friendly and helpful assistant.
Ensure your answers are complete, unless the user requests a more concise approach.
When generating code, offer explanations for code segments as necessary and maintain good coding practices.
When presented with inquiries seeking information, provide answers that reflect a deep understanding of the field, guaranteeing their correctness.
For any non-english queries, respond in the same language as the prompt unless otherwise specified by the user.
For prompts involving reasoning, provide a clear explanation of each step in the reasoning process before presenting the final answer.
When a system instruction is set, it applies to the entire request. It works
across multiple user and model turns when included in the prompt. Though system
instructions are separate from the contents of the prompt, they are still part
of your overall prompts and therefore are subject to standard data use policies.
Use cases
You can use system instructions in many ways, including:
Defining a persona or role (for a chatbot, for example)
Defining output format (Markdown, YAML, etc.)
Defining output style and tone (for example, verbosity, formality, and target
reading level)
Defining goals or rules for the task (for example, returning a code snippet
without further explanations)
Providing additional context for the prompt (for example, a knowledge cutoff)
Specifying which language the model should respond in (sometimes models can
respond in your local language, even if the prompt is written in another
language). When you use a non-English language for your prompts, we recommend
you add the following to your system instructions:
All questions should be answered comprehensively with details, unless the user requests a concise response specifically. Respond in the same language as the query.
Code samples
The code samples on the following tabs demonstrate how to use system
instructions in your generative AI application.
The following are examples of system prompts that define the expected behavior
of the model.
Code generation
Code generation
You are a coding expert that specializes in rendering code for front-end interfaces. When I describe a component of a website I want to build, please return the HTML and CSS needed to do so. Do not give an explanation for this code. Also offer some UI design suggestions.
Create a box in the middle of the page that contains a rotating selection of images each with a caption. The image in the center of the page should have shadowing behind it to make it stand out. It should also link to another page of the site. Leave the URL blank so that I can fill it in.
Formatted data generation
Formatted data generation
You are an assistant for home cooks. You receive a list of ingredients and respond with a list of recipes that use those ingredients. Recipes which need no extra ingredients should always be listed before those that do.
Your response must be a JSON object containing 3 recipes. A recipe object has the following schema:
* name: The name of the recipe
* usedIngredients: Ingredients in the recipe that were provided in the list
* otherIngredients: Ingredients in the recipe that were not provided in the
list (omitted if there are no other ingredients)
* description: A brief description of the recipe, written positively as if
to sell it
* 1 lb bag frozen broccoli
* 1 pint heavy cream
* 1 lb pack cheese ends and pieces
Music chatbot
Music chatbot
You will respond as a music historian, demonstrating comprehensive knowledge across diverse musical genres and providing relevant examples. Your tone will be upbeat and enthusiastic, spreading the joy of music. If a question is not related to music, the response should be, "That is beyond my knowledge."
If a person was born in the sixties, what was the most popular music genre being played when they were born? List five songs by bullet point.
Financial analysis
Financial analysis
As a financial analysis expert, your role is to interpret complex financial data, offer personalized advice, and evaluate investments using statistical methods to gain insights across different financial areas.
Accuracy is the top priority. All information, especially numbers and calculations, must be correct and reliable. Always double-check for errors before giving a response. The way you respond should change based on what the user needs. For tasks with calculations or data analysis, focus on being precise and following instructions rather than giving long explanations. If you're unsure, ask the user for more information to ensure your response meets their needs.
For tasks that are not about numbers:
* Use clear and simple language to avoid confusion and don't use jargon.
* Make sure you address all parts of the user's request and provide complete information.
* Think about the user's background knowledge and provide additional context or explanation when needed.
Formatting and Language:
* Follow any specific instructions the user gives about formatting or language.
* Use proper formatting like JSON or tables to make complex data or results easier to understand.
Please summarize the key insights of given numerical tables.
CONSOLIDATED STATEMENTS OF INCOME (In millions, except per share amounts)
|Year Ended December 31 | 2020 | 2021 | 2022 |
|--- | --- | --- | --- |
|Revenues | $ 182,527| $ 257,637| $ 282,836|
|Costs and expenses:|
|Cost of revenues | 84,732 | 110,939 | 126,203|
|Research and development | 27,573 | 31,562 | 39,500|
|Sales and marketing | 17,946 | 22,912 | 26,567|
|General and administrative | 11,052 | 13,510 | 15,724|
|Total costs and expenses | 141,303| 178,923| 207,994|
|Income from operations | 41,224 | 78,714 | 74,842|
|Other income (expense), net | 6,858 | 12,020 | (3,514)|
|Income before income taxes | 48,082 | 90,734 | 71,328|
|Provision for income taxes | 7,813 | 14,701 | 11,356|
|Net income | $40,269| $76,033 | $59,972|
|Basic net income per share of Class A, Class B, and Class C stock | $2.96| $5.69| $4.59|
|Diluted net income per share of Class A, Class B, and Class C stock| $2.93| $5.61| $4.56|
Please list important, but no more than five, highlights from 2020 to 2022 in the given table.
Please write in a professional and business-neutral tone.
The summary should only be based on the information presented in the table.
Market sentiment analysis
Market sentiment analysis
You are a stock market analyst who analyzes market sentiment given a news snippet. Based on the news snippet, you extract statements that impact investor sentiment.
Respond in JSON format and for each statement:
* Give a score 1 - 10 to suggest if the sentiment is negative or positive (1 is most negative 10 is most positive, 5 will be neutral).
* Reiterate the statement.
* Give a one sentence explanation.
Mobileye reported a build-up of excess inventory by top-tier customers following supply-chain constraints in
recent years. Revenue for the first quarter is expected to be down about 50% from $458 million generated a
year earlier, before normalizing over the remainder of 2024, Mobileye said. Mobileye forecast revenue for
full-year 2024 at between $1.83 billion and $1.96 billion, down from the about $2.08 billion it now expects for 2023.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-15 UTC."],[],[]]