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 / NanoBanana-JavaScript.md
Last active September 2, 2025 13:15
Use Nano Banana in JavaScript/TypeScript
@patrickloeber
patrickloeber / NanoBanana-Python.md
Last active September 2, 2025 13:12
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,
@patrickloeber
patrickloeber / speech_understanding.md
Last active April 17, 2024 13:41
Speech Understanding with Python and AssemblyAI

Speech Understanding with Python and AssemblyAI

Learn everything about using AI for speech understanding with Python.

I'll show you how to perform the following tasks on a podcast episode:

  • Automatic speech recognition (ASR)
  • Getting word-level timestamps
  • Getting sentences with timestamps
  • Identifying speaker labels
@patrickloeber
patrickloeber / typescript_langchainjs.md
Last active August 22, 2023 09:16
typescript_langchainjs.md
npm init

npm install --save-dev typescript
npx tsc --init

npm install -S langchain

npm install -S dotenv
npm i --save-dev @types/node