Skip to content

Instantly share code, notes, and snippets.

View patrickloeber's full-sized avatar
💻
building

Patrick Loeber patrickloeber

💻
building
View GitHub Profile
@patrickloeber
patrickloeber / main.py
Last active September 23, 2025 08:16
Native audio example
"""
Install dependencies:
brew install portaudio
pip install -U google-genai pyaudio
Use headphones to avoid echo cancellation, then talk to Gemini.
"""
import asyncio
@patrickloeber
patrickloeber / README.md
Created September 4, 2025 11:31
How to build with Nano Banana: Complete Developer Tutorial

How to build with Nano Banana: Complete Developer Tutorial

Google has recently released Gemini 2.5 Flash Image, a powerful new model for image generation and editing, also known by its codename, Nano Banana. This model introduces state-of-the-art capabilities for creating and manipulating images, unlocking a wide range of new applications.

This guide provides a comprehensive walkthrough for developers looking to integrate Gemini 2.5 Flash Image aka Nano Banana into their applications using the Gemini Developer API.

This guide will cover:

  1. Using Nano Banana in AI Studio
  2. Project setup
@patrickloeber
patrickloeber / NanoBanana-JavaScript.md
Last active November 16, 2025 15:55
Use Nano Banana in JavaScript/TypeScript
@patrickloeber
patrickloeber / NanoBanana-Python.md
Last active September 14, 2025 04:10
Use Nano Banana in Python
@patrickloeber
patrickloeber / main.ts
Last active August 5, 2025 07:48
AI SDK + Gemini market researcher example
import { google } from "@ai-sdk/google";
import { z } from "zod";
import { generateText, generateObject } from "ai";
import "dotenv/config";
import puppeteer from "puppeteer";
import { ChartConfiguration } from "chart.js";
function createChartConfig({labels, data, label, type, colors,}: {
labels: string[];
data: number[];
@patrickloeber
patrickloeber / AISDK-Gemini.md
Last active August 18, 2025 09:37
AISDK-Gemini
Title Description
Market Research Agent with Gemini and the Vercel AI SDK
Building apps with Gemini and the Vercel AI SDK

Market Research Agent with Gemini and the Vercel AI SDK

The Vercel AI SDK is a powerful open-source library for building AI-powered applications, user interfaces, and agents in TypeScript.

@patrickloeber
patrickloeber / ai-sdk-gemini.md
Last active June 1, 2025 15:08
AI SDK with Gemini API
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import { RealtimeTranscriber, RealtimeTranscript } from 'assemblyai';
import { getAssemblyToken } from './getAssemblyToken';
export async function createTranscriber(
transcriptionProcessed: (transcription: string, isFinal: boolean) => void
): Promise<RealtimeTranscriber | undefined> {
const token = await getAssemblyToken();
if (!token) {
console.error('No token found');
import assemblyai as aai
aai.settings.api_key = "API_KEY"
audio_url = "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3"
config = aai.TranscriptionConfig().set_redact_pii(
policies=[
aai.PIIRedactionPolicy.person_name,
aai.PIIRedactionPolicy.organization,