Skip to content

Instantly share code, notes, and snippets.

export const generateValidationQueries = async (files: FileInfo[], n: number = 15, model: string) => {
// using math.js
const sampleFiles = math.pickRandom(files, n) as unknown as FileInfo[]
const validationQueries: SampleQuery[] = []
const createPrompt = (code: string) => {
return `Consider the following code:
${code}
Write some queries that someone would use to look for a specific piece or area of code.
Here are some sample queries:
export type FileInfo = {
content: string
path: string
filename: string
functions?: FunctionInfo[]
}
export type FunctionInfo = {
function: string
functionName: string
import { getEncoding } from "js-tiktoken";
function chunkFunctions(files: FileInfo[], maxTokens: number): string[] {
const chunks: string[] = [];
let currentChunk = '';
// initialize the encoder
const encoder = getEncoding('cl100k_base');
for (const file of files) {
export const generateValidationSet = (files: FileInfo[], n: number = 15) => {
// (...)
// this is an edit
}
import * as crypto from 'crypto'
const ALGORITHM = {
BLOCK_CIPHER: 'aes-256-gcm',
AUTH_TAG_BYTE_LEN: 16,
IV_BYTE_LEN: 12,
KEY_BYTE_LEN: 32,
SALT_BYTE_LEN: 16
}
{"transcription": " See you next time.", "confidence": 0.36, "language": "en", "type": "partial", "time_begin": 3.234, "time_end": 4.53525}
{"transcription": " Click onto the address for the test.", "confidence": 0.31, "language": "en", "type": "partial", "time_begin": 3.234, "time_end": 6.802875}
{"transcription": " Welcome to the Just Reads Podcast. I'm your host,", "confidence": 0.51, "language": "en", "type": "final", "time_begin": 3.234, "time_end": 7.838}
{"transcription": " That's a shit fool.", "confidence": 0.26, "language": "en", "type": "partial", "time_begin": 1.026, "time_end": 2.267625}
{"transcription": " This is part 2.", "confidence": 0.56, "language": "en", "type": "final", "time_begin": 1.026, "time_end": 3.486}
{"transcription": " So, so, as in the spices.", "confidence": 0.3, "language": "en", "type": "partial", "time_begin": 1.186, "time_end": 4.5351875}
{"transcription": " Toad series on the space industry. We have to-", "confidence": 0.39, "language": "en", "type": "final", "time_begin
[
{
"text": "Hello dear ones. Today I want to talk about a very simple concept and yet 1 that might be very new to you. And it's the concept that your pain, your tension, any symptoms you might be experiencing related to health conditions, are things like a headache, are you know flare-ups. These are all ways that your body is 1 sending you signals and 2 meeting your needs. Yes, yes, yes, yes. Pain and symptoms are your body meeting your needs. Let me dive into this and caveat that Maybe this isn't true for every condition. Maybe there's nuance and so I just invite you to listen to this with curiosity. You know, see if it fits for you. If it doesn't, that's okay. And you know, let it unfold. Don't rush to any conclusions on whether this is true for you. Okay so pain, fatigue, symptom flare-ups these really suck and most of us including previously myself orient to these by either trying to make them go away, fix them, or avoid them, or just like trying to manage the pain of it, the discomfort.",
@calebdre
calebdre / topics.txt
Last active July 24, 2023 17:31
topics1
For episode 13:
[
{
"text": "Today's podcast is an awe inducing practice called 1, 2, 3 space, facilitated by Nick Zaleski. This 10 minute practice takes you from the thinking space to feeling space and ending in awe to help you compare and contrast while building the capacity to see, eat, and feel from the seat of awe.",
"start_word": 0,
"end_word": 53,
"topics": [
{
"topic": "podcasts",
"confidence": 0.99995506
@calebdre
calebdre / t.txt
Created July 19, 2023 16:10
gladio long transcript
[1.00-4.00]
There's no place to escape to. This is the last stop.
[5.00-6.00]
On the left.
[9.00-11.00]
That's when the cannibalism started.
[12.00-13.00]
What was that?
[20.00-26.00]
I was doing some research because a listener sent me a bit of information about FDR's final days.
@calebdre
calebdre / t.json
Created July 19, 2023 16:10
deepgram long transcript
This file has been truncated, but you can view the full file.
{
"metadata": {
"transaction_key": "deprecated",
"request_id": "96d6c364-8984-403a-84c7-9f1aba888e9d",
"sha256": "d1bffdcfa95e9a2b53bc776a0f9a6586aec4d925afa5004c550dedcf5fe95366",
"created": "2023-07-19T16:03:37.459Z",
"duration": 6790.635,
"channels": 1,
"models": [
"85b5dbfd-bc1d-46b5-99d8-070d379a7f97"