Skip to content

Instantly share code, notes, and snippets.

View ShayneP's full-sized avatar

Shayne Parmelee ShayneP

View GitHub Profile
mutation {
fulfillmentOrderReschedule(
id: "gid://shopify/FulfillmentOrder/1899851251768",
fulfillAt: "2021-01-01"
)
{
fulfillmentOrder {
fulfillAt
}
userErrors {
mutation {
fulfillmentOrderReschedule(
id: "gid://shopify/FulfillmentOrder/1899851251768",
fulfillAt: "2022-01-01"
)
{
fulfillmentOrder {
fulfillAt
}
userErrors {
@ShayneP
ShayneP / realtime_agent.py
Last active October 8, 2024 02:39
A simple implementation of a Realtime Agent using LiveKit.
from __future__ import annotations
import logging
from livekit import rtc
from livekit.agents import (
AutoSubscribe,
JobContext,
WorkerOptions,
cli,
llm,
)
@ShayneP
ShayneP / vision_fine_tune.json
Created October 7, 2024 14:03
Sample of vision fine tune for OpenAI
{
"messages": [
{ "role": "system", "content": "You are an assistant that identifies uncommon cheeses." },
{ "role": "user", "content": "What is this cheese?" },
{ "role": "user", "content": [
{
"type": "image_url",
"image_url": {
"url": "<https://upload.wikimedia.org/wikipedia/commons/3/36/Danbo_Cheese.jpg>"
}
@ShayneP
ShayneP / upload_training.py
Last active October 7, 2024 18:52
Upload training JSON file
from openai import OpenAI
client = OpenAI()
client.files.create(
file=open("mydata.jsonl", "rb"),
purpose="fine-tune"
)
client.fine_tuning.jobs.create(
training_file="mydata",
@ShayneP
ShayneP / create_fine_tuned_model.py
Created October 7, 2024 14:06
Create fine tuned model
from openai import OpenAI
client = OpenAI()
client.fine_tuning.jobs.create(
training_file="mydata",
model="gpt-4o-mini-2024-07-18"
)
@ShayneP
ShayneP / store_response.py
Created October 7, 2024 14:07
Store response from OpenAI API for eval & training
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "what's the capital of the USA?"
}
@ShayneP
ShayneP / main.py
Created October 16, 2024 18:05
Connecting to a LiveKit room with audio from the terminal
import asyncio
import logging
import os
from dotenv import load_dotenv
from livekit import rtc, api
import sounddevice as sd
import numpy as np
import signal
import queue
@ShayneP
ShayneP / basic_agent.py
Created January 15, 2025 20:08
Basic LiveKit Agent
from dotenv import load_dotenv
from livekit.agents import (
AutoSubscribe,
JobContext,
JobProcess,
WorkerOptions,
cli,
llm,
)
from livekit.agents.pipeline import VoicePipelineAgent
@ShayneP
ShayneP / basic_agent.py
Created January 28, 2025 20:41
LiveKit, DeepSeek, and Groq
import asyncio
import logging
import os
import aiohttp
from typing import Annotated
from dotenv import load_dotenv
from livekit import rtc
from livekit.agents import (
AutoSubscribe,
JobContext,