mirror of
https://github.com/hanzoai/dataroom.git
synced 2026-10-30 18:41:07 +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.
58 lines
1010 B
TypeScript
58 lines
1010 B
TypeScript
import prisma from "@/lib/prisma";
|
|
|
|
interface CreateChatOptions {
|
|
teamId: string;
|
|
documentId?: string;
|
|
dataroomId?: string;
|
|
linkId?: string;
|
|
viewId?: string;
|
|
userId?: string;
|
|
viewerId?: string;
|
|
vectorStoreId?: string;
|
|
title?: string;
|
|
}
|
|
|
|
/**
|
|
* Create a new chat session
|
|
* @param options - Chat creation options
|
|
* @returns The created chat
|
|
*/
|
|
export async function createChat(options: CreateChatOptions) {
|
|
const {
|
|
teamId,
|
|
documentId,
|
|
dataroomId,
|
|
linkId,
|
|
viewId,
|
|
userId,
|
|
viewerId,
|
|
vectorStoreId,
|
|
title,
|
|
} = options;
|
|
|
|
try {
|
|
const chat = await prisma.chat.create({
|
|
data: {
|
|
teamId,
|
|
documentId,
|
|
dataroomId,
|
|
linkId,
|
|
viewId,
|
|
userId,
|
|
viewerId,
|
|
vectorStoreId,
|
|
title,
|
|
},
|
|
include: {
|
|
messages: true,
|
|
},
|
|
});
|
|
|
|
return chat;
|
|
} catch (error) {
|
|
console.error("Error creating chat:", error);
|
|
throw new Error("Failed to create chat");
|
|
}
|
|
}
|
|
|