This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dotenv import load_dotenv | |
from google import genai | |
from pydantic import BaseModel | |
import argparse | |
import logging | |
from datetime import datetime | |
load_dotenv() | |
parser = argparse.ArgumentParser(description="Amy and Frank chatbot simulator") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User input: Hey :) tell me something about yourself, the first thing that comes to mind | |
Response: role='assistant' content="**Amy:** Hmm, the first thing that comes to mind... I was just thinking about how much I enjoy getting lost in London. Not literally lost, but exploring hidden streets and noticing the details in old buildings. It's funny how a walk can sometimes feel like a journey through time." | |
User input: Journey through time... does That means that you get lost in historical parts? | |
Response: role='assistant' content="**Amy:** Not *just* historical parts, though I do love the stories old buildings tell. It's more about how different eras blend together, or stumbling upon a quiet mews tucked away behind a bustling street. Like finding a little secret history within the modern city. Do you find yourself drawn to any particular parts of London?" | |
User input: I loooove the mews, South Kensington is so good for that. What's certainly interesting is the City on the weekend, so empty and pristine | |
Response: r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const url = `https://texttospeech.googleapis.com/v1/text:synthesize?key=${apiKey}` | |
const request = { | |
input: { ssml: ssmlInput }, | |
voice: { | |
name: "en-US-Studio-O", | |
languageCode: "en-US", | |
// ssmlGender: "MALE", | |
}, | |
audioConfig: { audioEncoding: "MP3" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { derived, type Readable } from "svelte/store" | |
export type AsyncDerivedState<T> = | |
| { | |
status: "loading" | |
data: undefined | |
error: undefined | |
} | |
| { | |
status: "success" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract type AbstractModel end | |
"""default conversion of struct name to table name""" | |
tablename(::Type{T}) where {T<:AbstractModel} = T |> string |> lowercase |> to_plural | |
"""default primary key""" | |
pk(::Type{T}) where {T<:AbstractModel} = T |> fieldnames |> first | |
"""get the primary key""" | |
pk(m::T) where {T<:AbstractModel} = getfield(m, pk(T)) |