Python 88.3%
TypeScript 7.6%
Shell 4.1%
1#!/usr/bin/env bash2# STATUS: LIVE_VERIFIED — executed 2026-09-18 (exit 0 in 0.9s)3# streamGenerateContent with ?alt=sse (SSE framing) — prints each chunk's text and the final finishReason/usage.4# Run: bash examples/gemini/streaming/stream.sh (key injected from .env by scripts/lib.sh `gemini` wrapper; never printed)5set -eo pipefail6source "$(dirname "$0")/../../../scripts/lib.sh"; out="$(mktemp)"; trap 'rm -f "$out"' EXIT7MODEL="gemini-3.5-flash-lite"8curl -sS -N -X POST "https://generativelanguage.googleapis.com/v1beta/models/$MODEL:streamGenerateContent?alt=sse" -H "x-goog-api-key: $GEMINI_API_KEY" -H "Content-Type: application/json" \9 -d '{"contents":[{"role":"user","parts":[{"text":"Count from 1 to 12 separated by spaces."}]}],"generationConfig":{"maxOutputTokens":32}}' -o "$out" -w '%{http_code}' > "$out.code"10grep -c '^data:' "$out" | sed 's/^/chunks: /'; mask < "$out" | tail -c 700; echo11echo "HTTP $(cat "$out.code")"; log_request gemini POST "/v1beta/models/{model}:streamGenerateContent" "$(cat "$out.code")" 0.00007 "example streaming/stream.sh (alt=sse)"; rm -f "$out.code"12