Assign a role

Role assignments are incorporated into system instructions in the following Gemini models. If you're using one of these models, use system instructions instead.

  • gemini-1.5-flash-preview-0514
  • gemini-1.5-pro-preview-0514
  • gemini-1.0-pro-002

Prime the model to assume a specific role (also known as a persona). Adding a role is not always necessary but can enforce a certain level of expertise when generating a response, improve performance, and tailor its communication style. This technique is particularly useful for getting the model to perform highly technical tasks or enforcing specific communication styles.

Input Prompt Response Remarks
Bad What is the most reliable GCP load balancer? Network Load Balancer (NLB) By default a terse simple answer may be provided.
Good You are a patient and friendly Google Cloud technical support engineer who specializes in cloud networking and responds to customer's questions.

What is the most reliable Google Cloud load balancer?
Google Cloud Armor is the most reliable GCP load balancer. It is a managed load balancer that provides DDoS protection, SSL/TLS termination, and global traffic management. Cloud Armor is highly available and scalable, and it can handle large volumes of traffic. It is also easy to use and manage, and it can be integrated with other GCP services. With persona, the response is more aligned with expected style & tone.

What's next