Skip to content

Instantly share code, notes, and snippets.

@grahama1970
Created June 18, 2025 16:27
Show Gist options
  • Save grahama1970/3d312bf018059e882b6c3a18fdfd714c to your computer and use it in GitHub Desktop.
Save grahama1970/3d312bf018059e882b6c3a18fdfd714c to your computer and use it in GitHub Desktop.
ask-gemini

Ask Gemini Flash Command

Ask Gemini Flash this question and get a quick, balanced response: $ARGUMENTS

Expected Output:

  • Provide clear, concise answers (limit ~500 tokens)
  • Use creative but accurate tone
  • For complex code tasks, suggest using ask-gemini-pro instead
  • If unable to answer, explain why clearly

Code Example:

from dotenv import load_dotenv
load_dotenv('/home/graham/workspace/experiments/llm_call/.env')
import os
from litellm import completion

model = os.getenv('SLASHCMD_ASK_GEMINI_FLASH_MODEL')  # Gets configured Gemini Flash model
response = completion(
    model=model,
    messages=[{"role": "user", "content": "YOUR_QUERY"}],
    temperature=0.7,  # Balanced creativity
    max_tokens=500    # Reasonable response length
)
print(response.choices[0].message.content)

Model Information:

  • vertex_ai/gemini-1.5-flash: Fast, cost-efficient version of Gemini 1.5
  • Good for: Code generation, analysis, general questions, quick responses
  • Features: Multi-modal support, function calling, safety settings

Environment Requirements:

  • GOOGLE_APPLICATION_CREDENTIALS: Path to service account JSON file
  • VERTEX_PROJECT: Google Cloud project ID (optional, can be in credentials)
  • VERTEX_LOCATION: Region like 'us-central1' (optional)

Helpful Documentation:

Usage Examples:

  • /user:ask-gemini-flash Write a Python function to calculate fibonacci
  • /user:ask-gemini-flash Explain quantum computing in simple terms
  • /user:ask-gemini-flash Debug this code: [paste code]

Notes:

  • Ensure Google Cloud credentials are properly configured
  • Flash model is optimized for speed and cost-efficiency
  • For complex reasoning tasks, consider using gemini-1.5-pro instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment