mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 13:25:18 +00:00
ci: use local prisma client
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { fileExists, fullPathForFile } from "@/lib/files"
|
||||
import { generateFilePreviews } from "@/lib/previews/generate"
|
||||
import { File, User } from "@prisma/client"
|
||||
import { File, User } from "@/prisma/client"
|
||||
import fs from "fs/promises"
|
||||
|
||||
const MAX_PAGES_TO_ANALYZE = 4
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Category, Field, Project } from "@prisma/client"
|
||||
import { Category, Field, Project } from "@/prisma/client"
|
||||
|
||||
export function buildLLMPrompt(
|
||||
promptTemplate: string,
|
||||
|
||||
13
ai/schema.ts
13
ai/schema.ts
@@ -1,13 +1,16 @@
|
||||
import { Field } from "@prisma/client"
|
||||
import { Field } from "@/prisma/client"
|
||||
|
||||
export const fieldsToJsonSchema = (fields: Field[]) => {
|
||||
const fieldsWithPrompt = fields.filter((field) => field.llm_prompt)
|
||||
const schema = {
|
||||
type: "object",
|
||||
properties: fieldsWithPrompt.reduce((acc, field) => {
|
||||
acc[field.code] = { type: field.type, description: field.llm_prompt || "" }
|
||||
return acc
|
||||
}, {} as Record<string, { type: string; description: string }>),
|
||||
properties: fieldsWithPrompt.reduce(
|
||||
(acc, field) => {
|
||||
acc[field.code] = { type: field.type, description: field.llm_prompt || "" }
|
||||
return acc
|
||||
},
|
||||
{} as Record<string, { type: string; description: string }>
|
||||
),
|
||||
required: fieldsWithPrompt.map((field) => field.code),
|
||||
additionalProperties: false,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user