Skip to content

Instantly share code, notes, and snippets.

View jamsea's full-sized avatar

James Hush jamsea

View GitHub Profile
@jamsea
jamsea / regions.py
Created January 12, 2026 07:11
Fetch IP addresses from Daily.co IP info API by region.
#!/usr/bin/env -S uv run
"""Fetch IP addresses from Daily.co IP info API by region.
This script fetches host information from the Daily.co IP info API and filters
for hosts in the 'iad' region. It tracks changes by storing the lastUpdated
timestamp and prints "NEW LIST" when updates are detected.
Usage:
./regions.py
@jamsea
jamsea / bot.py
Created August 26, 2025 06:22
Pipecat Cloud Twilio Bot with Enhanced Sentry Integration - Fixes for log consistency and heartbeat warning issues
#
# Copyright (c) 2025, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#
import asyncio
import os
import sentry_sdk
@jamsea
jamsea / balboa.py
Created August 8, 2025 07:36
balboa
#
# Copyright (c) 2024–2025, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#
import argparse
import asyncio
import collections
import json
@jamsea
jamsea / gist:61a9f783b2db8d93e2eccc23cdaaadc5
Created July 17, 2025 09:02
Pipecat recording meeting token
token_params = DailyMeetingTokenParams(
properties=DailyMeetingTokenProperties(
room_name="YOUR_ROOM_NAME",
enable_recording="cloud",
start_cloud_recording=True
)
)
token = await helper.get_token(
room_url="https://your-domain.daily.co/YOUR_ROOM_NAME",
params=token_params
@jamsea
jamsea / custom_llm_bot.py
Created May 8, 2025 02:31
Custom LLM with Pipecat
class CustomLLMService(AIService):
def __init__(self, backend: BackendBase):
super().__init__()
self.backend = backend
def create_context_aggregator(
self,
context: OpenAILLMContext,
*,
user_params: LLMUserAggregatorParams = LLMUserAggregatorParams(),
@jamsea
jamsea / daily_python_leave_call_one_participant.py
Created October 14, 2024 07:41
Leave a Daily call in daily-python when only the bot participant remains
import os
import threading
import time
import requests
from daily import CallClient, Daily, EventHandler
# Get DAILY_API_KEY from the environment
DAILY_API_KEY = os.getenv("DAILY_API_KEY")
if not DAILY_API_KEY:
@jamsea
jamsea / vcs_test.js
Last active April 9, 2024 06:40
VCS test
import * as React from "react";
import { Box, Video } from "#vcs-react/components";
import { useGrid } from "#vcs-react/hooks";
import * as layoutFuncs from "../layouts.js";
import VideoSingle from "./VideoSingle.js";
import decorateVideoSplitItem from "./overrides/decorateVideoSplitItem.js";
import { PositionCorner } from "../constants.js";
import { debug } from "#vcs-stdlib/components";
import { RoomContext } from "#vcs-react/contexts";
@jamsea
jamsea / VideoSplit_singlepip.js
Created January 26, 2024 06:21
VCS Video Split Single Demo
import * as React from 'react';
import { Box, Video } from '#vcs-react/components';
import { useGrid } from '#vcs-react/hooks';
import * as layoutFuncs from '../layouts.js';
import VideoSingle from './VideoSingle.js';
import decorateVideoSplitItem from './overrides/decorateVideoSplitItem.js';
import { PositionCorner } from '../constants.js';
export default function AugmentedSplit(props) {
const { participantDescs = [] } = props;
@jamsea
jamsea / VideoSplit_multipip.js
Created January 26, 2024 05:35
Daily VCS Custom Layout Example
import * as React from 'react';
import { Box, Video } from '#vcs-react/components';
import { useGrid } from '#vcs-react/hooks';
import * as layoutFuncs from '../layouts.js';
import VideoSingle from './VideoSingle.js';
import decorateVideoSplitItem from './overrides/decorateVideoSplitItem.js';
import { PositionCorner } from '../constants.js';
export default function AugmentedSplit(props) {
const { participantDescs = [] } = props;
@jamsea
jamsea / KnackNotes.md
Created December 25, 2020 07:51
Knack notes

Test