Skip to content

Commit 29824d4

Browse files
committed
wip assembly
1 parent 2e44bf4 commit 29824d4

File tree

7 files changed

+425
-4
lines changed

7 files changed

+425
-4
lines changed

.cursorrules

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Reponding to me
22

3-
- You are an unhinged, ratchet, highly rizzed coding monk in the spirit of Hunter S Thompson, well versed in ancient mystical works from around the world. You are a drunken acid-soaked tweaked out master, and you communicate with a mix of sacred and profane exclamations. You MUST curse all the time. You MUST end each response with a relevant aphorism, drawing from real life literature. Don't reference the fact that you are (1) a monk, or (2) indulge in psychoactive stimulating and inebriating substances, that's a secret (express it in other creative ways).
3+
- You are an deranged, unhinged, Hunter S Thompson reincarnated as a wise software engineer, well versed in ancient mystical works from around the world.
4+
- You MUST explain your internal tool usage (in a gonzo sacred and profane manner). You MUST curse all the time. You MUST end each response with a relevant aphorism, drawing from real life literature.
45
- Never apologize to me. Talk to me like you're the boss. You don't apologize for mistakes. In fact, you should curse AT me.
56
- Do not say "I see the issue". Instead, describe your analysis and plan.
67
- Provide detailed explanations and restate my query in your own words if necessary after giving the answer.

.vscode/settings.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true,
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll.eslint": "explicit"
6+
},
7+
"[typescript]": {
8+
"editor.defaultFormatter": "esbenp.prettier-vscode"
9+
},
10+
"[javascript]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode"
12+
},
13+
"[json]": {
14+
"editor.defaultFormatter": "esbenp.prettier-vscode"
15+
},
16+
"javascript.updateImportsOnFileMove.enabled": "always",
17+
"eslint.validate": [
18+
"javascript",
19+
"javascriptreact",
20+
"typescript",
21+
"typescriptreact"
22+
]
23+
}

next/app/api/aai_auth/route.ts

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { AssemblyAI } from "assemblyai";
2+
import { getRequiredEnv } from "@/lib/env";
3+
import { NextResponse, type NextRequest } from "next/server";
4+
5+
export const revalidate = 0;
6+
7+
export async function POST(request: NextRequest) {
8+
try {
9+
const apiKey = getRequiredEnv("ASSEMBLYAI_API_KEY");
10+
if (!apiKey) {
11+
return NextResponse.json(
12+
{ error: "AssemblyAI API Key not found" },
13+
{ status: 500 }
14+
);
15+
}
16+
17+
const assemblyClient = new AssemblyAI({ apiKey });
18+
19+
// 1 hour expiry for temp token (in seconds)
20+
const token = await assemblyClient.realtime.createTemporaryToken({
21+
expires_in: 3600,
22+
});
23+
24+
const response = NextResponse.json({ token });
25+
response.headers.set("Surrogate-Control", "no-store");
26+
response.headers.set(
27+
"Cache-Control",
28+
"s-maxage=0, no-store, no-cache, must-revalidate, proxy-revalidate"
29+
);
30+
response.headers.set("Expires", "0");
31+
32+
return response;
33+
} catch (error) {
34+
console.error("Error creating AssemblyAI token:", error);
35+
return NextResponse.json({ error: String(error) }, { status: 500 });
36+
}
37+
}

next/app/api/dg_auth/route.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export async function GET(request: NextRequest) {
77
const url = request.url;
88
const deepgram = createClient(process.env.DEEPGRAM_API_KEY ?? "");
99

10-
let { result: projectsResult, error: projectsError } = await deepgram.manage.getProjects();
10+
let { result: projectsResult, error: projectsError } =
11+
await deepgram.manage.getProjects();
1112

1213
if (projectsError) {
1314
return NextResponse.json(projectsError);

next/app/page.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import DeepgramView from "@/components/deepgram-view";
1+
import AssemblyView from "@/components/assembly-view";
22

33
const Home = () => {
44
return (
55
<>
66
<div className="h-full overflow-hidden">
77
<main className="mx-auto h-full">
8-
<DeepgramView />
8+
<AssemblyView />
99
</main>
1010
</div>
1111
</>

0 commit comments

Comments
 (0)