Skip to content

Instantly share code, notes, and snippets.

View kwindla's full-sized avatar

Kwindla Hultman Kramer kwindla

View GitHub Profile
@kwindla
kwindla / bot.py
Created March 13, 2025 21:18
Gemini Multimodal Live French tutor
import asyncio
import os
import sys
from dataclasses import dataclass
import aiohttp
from dotenv import load_dotenv
from loguru import logger
from pipecat.audio.vad.silero import SileroVADAnalyzer
@kwindla
kwindla / bot.py
Created March 11, 2025 19:45
Cartesia Sonic-2 Language Teacher
import asyncio
import os
import sys
from dataclasses import dataclass
import aiohttp
import google.ai.generativelanguage as glm
from dotenv import load_dotenv
from loguru import logger
from runner import configure
@kwindla
kwindla / 19b-azure-realtime-beta.py
Created March 1, 2025 23:15
Wrap Pipecat OpenAI Realtime API service to work with Azure WebSocket connection format
#
# Copyright (c) 2024–2025, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#
import asyncio
import os
import sys
from datetime import datetime
@kwindla
kwindla / voice-agent-example.py
Last active February 11, 2025 18:47
Pipeline with lookup example
async def start_query_knowledge_base(function_name, llm, context):
"""Push a frame to the TTS service; this is handy when the LLM response might take a while."""
await llm.push_frame(TTSSpeakFrame("Please hold on while I look that order up for you."))
async def query_knowledge_base(function_name, tool_call_id, args, llm, context, result_callback):
query_result = knowledge_base.get(args["query"])
await result_callback({
"info": json.dumps({
"lookup_success": True,
"order_status": query_result["order_status"],
@kwindla
kwindla / gemini-lights-repro.py
Created December 15, 2024 03:32
Gemini Multimodal Live compositional function calling test
# usage: gemini-lights-repro.py --initial-message "Make a pretty sequence with the lights. Turn them on and off a few times. Pick nice colors."
import argparse
import asyncio
import base64
import json
import os
import pyaudio
import re
import shutil
@kwindla
kwindla / gemini-talk.py
Created December 11, 2024 16:45
Gemini Multimodal Live API minimal client (use headphones)
# installation:
#
# python3.12 -m venv venv
# source venv/bin/activate
#
# pip install pyaudio websockets
# usage:
#
# export GEMINI_API_KEY=...
@kwindla
kwindla / talk.py
Created October 7, 2024 01:59
command-line openai realtime
import asyncio
import base64
import json
import os
import pyaudio
import shutil
import websockets
class AudioStreamer:
@kwindla
kwindla / runner.py
Created August 4, 2024 17:16
RTVI bot helper runner - 2024-08-04
#
# Copyright (c) 2024, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#
import aiohttp
import argparse
import os
@kwindla
kwindla / rtvi-bot-20240804.py
Created August 4, 2024 17:14
RTVI simple bot example, 2024-08-04
import aiohttp
import asyncio
import os
import sys
from pipecat.frames.frames import EndFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.pipeline.runner import PipelineRunner
from pipecat.processors.frameworks.rtvi import (
@kwindla
kwindla / khk-sonnet-3.5-ice-cream.py
Created June 21, 2024 00:59
Anthropic Claude Sonnet 3.5 inventing new ice cream flavors (Pipecat voice bot)
import asyncio
import aiohttp
import os
import sys
from pipecat.frames.frames import LLMMessagesFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.llm_response import (