mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 21:35:19 +00:00
* feat: add google provider * fix: default for google model * feat: multiple providers * fix: defaults from env for login form * fix: add mistral to env files * chore: delete unused code * chore: revert database url to original * fix: render default value for api key from env on server * fix: type errors during compilation --------- Co-authored-by: Vasily Zubarev <me@vas3k.ru>
45 lines
1.6 KiB
TypeScript
45 lines
1.6 KiB
TypeScript
import { randomHexColor } from "@/lib/utils"
|
|
import { z } from "zod"
|
|
|
|
export const settingsFormSchema = z.object({
|
|
default_currency: z.string().max(5).optional(),
|
|
default_type: z.string().optional(),
|
|
default_category: z.string().optional(),
|
|
default_project: z.string().optional(),
|
|
openai_api_key: z.string().optional(),
|
|
openai_model_name: z.string().default('gpt-4o-mini'),
|
|
google_api_key: z.string().optional(),
|
|
google_model_name: z.string().default("gemini-2.5-flash"),
|
|
mistral_api_key: z.string().optional(),
|
|
mistral_model_name: z.string().default("mistral-medium-latest"),
|
|
llm_providers: z.string().default('openai,google,mistral'),
|
|
prompt_analyse_new_file: z.string().optional(),
|
|
is_welcome_message_hidden: z.string().optional(),
|
|
})
|
|
|
|
export const currencyFormSchema = z.object({
|
|
code: z.string().max(5),
|
|
name: z.string().max(32),
|
|
})
|
|
|
|
export const projectFormSchema = z.object({
|
|
name: z.string().max(128),
|
|
llm_prompt: z.string().max(512).nullable().optional(),
|
|
color: z.string().max(7).default(randomHexColor()).nullable().optional(),
|
|
})
|
|
|
|
export const categoryFormSchema = z.object({
|
|
name: z.string().max(128),
|
|
llm_prompt: z.string().max(512).nullable().optional(),
|
|
color: z.string().max(7).default(randomHexColor()).nullable().optional(),
|
|
})
|
|
|
|
export const fieldFormSchema = z.object({
|
|
name: z.string().max(128),
|
|
type: z.string().max(128).default("string"),
|
|
llm_prompt: z.string().max(512).nullable().optional(),
|
|
isVisibleInList: z.boolean().optional(),
|
|
isVisibleInAnalysis: z.boolean().optional(),
|
|
isRequired: z.boolean().optional(),
|
|
})
|