mirror of
https://github.com/hanzo-apps/dataroom.git
synced 2026-10-30 14:47:36 +00:00
hanzo-build-linux-amd64 is the only ARC runner pool installed on hanzo-k8s today (arm64 pool is paused until DigitalOcean ships arm64 droplets, per ~/work/hanzo/.github/RUNNERS.md). The arm64 job was waiting on spark-hanzoai-arm64 — not provisioned in this cluster — so every build sat in queue forever and the amd64 leg got cancelled. Set platforms: linux/amd64 on the reusable build call to skip arm64 entirely. Re-add arm64 if/when DO ships arm64 droplets and the spark runner pool comes back online.
48 lines
1.1 KiB
TypeScript
48 lines
1.1 KiB
TypeScript
import { get } from "@vercel/edge-config";
|
|
|
|
interface Prompts {
|
|
"generate-dataroom-system": string;
|
|
"generate-dataroom-user": string;
|
|
}
|
|
|
|
async function getPrompts(): Promise<Prompts> {
|
|
if (!process.env.EDGE_CONFIG) {
|
|
throw new Error("Edge Config not configured");
|
|
}
|
|
|
|
const prompts = await get<Prompts>("prompts");
|
|
|
|
if (!prompts) {
|
|
throw new Error("Prompts not found in Edge Config");
|
|
}
|
|
|
|
return prompts;
|
|
}
|
|
|
|
export async function getDataroomSystemPrompt(): Promise<string> {
|
|
const prompts = await getPrompts();
|
|
|
|
const prompt = prompts["generate-dataroom-system"];
|
|
|
|
if (!prompt || typeof prompt !== "string") {
|
|
throw new Error("Dataroom system prompt not found in Edge Config");
|
|
}
|
|
|
|
return prompt;
|
|
}
|
|
|
|
export async function getDataroomUserPrompt(
|
|
description: string,
|
|
): Promise<string> {
|
|
const prompts = await getPrompts();
|
|
|
|
const template = prompts["generate-dataroom-user"];
|
|
|
|
if (!template || typeof template !== "string") {
|
|
throw new Error("Dataroom user prompt not found in Edge Config");
|
|
}
|
|
|
|
return template.replace("{{DESCRIPTION}}", description.trim());
|
|
}
|
|
|