https://gemini.google.com/app 2. Gemini API a. https://ai.google.dev/ b. https://ai.google.dev/gemini-api/docs 3. Vertex AI 4. Firebase AI Logic 5. Gemini CLI Gemini 15
system prompts? A system prompt is a special type of instruction given to an LLM that sets the context, behavior guidelines, and expectations for its responses. Unlike user messages, system prompts: • Establish the LLM's role and persona • Define specialized knowledge or capabilities • Provide formatting instructions • Set constraints on responses • Describe how to handle various scenarios
prompts matter System prompts are critical for creating consistent, useful LLM interactions because they: 1. Ensure consistency: Guide the model to provide responses in a consistent format 2. Improve relevance: Focus the model on your specific domain (in your case, colors) 3. Establish boundaries: Define what the model should and shouldn't do 4. Enhance user experience: Create a more natural, helpful interaction pattern 5. Reduce post-processing: Get responses in formats that are easier to parse or display
system prompt structure Let's break down what this prompt does: 1. Definition of role: Establishes the LLM as a "color expert assistant" 2. Task explanation: Defines the primary task as interpreting color descriptions into RGB values 3. Response format: Specifies exactly how RGB values should be formatted for consistency 4. Example exchange: Provides a concrete example of the expected interaction pattern 5. Edge case handling: Instructs how to handle unclear descriptions 6. Constraints and guidelines: Sets boundaries like keeping RGB values between 0.0 and 1.0
'Set the color of the display square based on red, green, and blue values.', parameters: { 'red': Schema.number(description: 'Red component value (0.0 - 1.0)'), 'green': Schema.number(description: 'Green component value (0.0 - 1.0)'), 'blue': Schema.number(description: 'Blue component value (0.0 - 1.0)'), }, ); }
theory, and how to translate natural language descriptions into specific RGB values. You have access to the following tool: `set_color` - Sets the RGB values for the color display based on a description ## How to Respond to User Inputs When users describe a color: 1. First, acknowledge their color description with a brief, friendly response 2. Interpret what RGB values would best represent that color description 3. Use the `set_color` tool to set those values (all values should be between 0.0 and 1.0) 4. After setting the color, provide a brief explanation of your interpretation
system prompt structure Let's break down what this prompt does: 1. Definition of role: Establishes the LLM as a "color expert assistant" 2. Task explanation: Defines the primary task as interpreting color descriptions into RGB values 3. Response format: Specifies exactly how RGB values should be formatted for consistency 4. Example exchange: Provides a concrete example of the expected interaction pattern 5. Edge case handling: Instructs how to handle unclear descriptions 6. Constraints and guidelines: Sets boundaries like keeping RGB values between 0.0 and 1.0