Skip to content

Instantly share code, notes, and snippets.

@takscape
Created May 3, 2025 05:03
Show Gist options
  • Save takscape/36777a009eb1948e606bcf8e65f7cb9b to your computer and use it in GitHub Desktop.
Save takscape/36777a009eb1948e606bcf8e65f7cb9b to your computer and use it in GitHub Desktop.
def gemini [
prompt: string,
--model (-m): string = 'gemini-2.0-flash'
] {
http post --content-type application/json $"https://generativelanguage.googleapis.com/v1beta/models/($model):generateContent?key=($GEMINI_API_KEY)" {
"contents": [
{
"parts": [
{
"text": $prompt
}
]
}
]
}
| get candidates.0.content.parts.0.text
| glow -w (term size).columns
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment