refactor ai naming and make omni raw-json first

This commit is contained in:
Ruslan Bakiev
2026-02-23 09:32:59 +07:00
parent ab5370c831
commit 43b487ccec
13 changed files with 226 additions and 79 deletions

View File

@@ -255,7 +255,7 @@ export async function runCrmAgentFor(
);
}
export async function persistChatMessage(input: {
export async function persistAiMessage(input: {
role: ChatRole;
text: string;
plan?: string[];
@@ -279,7 +279,7 @@ export async function persistChatMessage(input: {
authorUserId?: string | null;
}) {
const hasStoredPayload = Boolean(input.changeSet || input.messageKind);
const data: Prisma.ChatMessageCreateInput = {
const data: Prisma.AiMessageCreateInput = {
team: { connect: { id: input.teamId } },
conversation: { connect: { id: input.conversationId } },
authorUser: input.authorUserId ? { connect: { id: input.authorUserId } } : undefined,
@@ -292,5 +292,5 @@ export async function persistChatMessage(input: {
} as any)
: undefined,
};
return prisma.chatMessage.create({ data });
return prisma.aiMessage.create({ data });
}