Skip to content

Commit

Permalink
fix: llm model must be chosen
Browse files Browse the repository at this point in the history
  • Loading branch information
comoser committed Sep 8, 2023
1 parent b1aefb1 commit 8a14e56
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 1 addition & 7 deletions packages/contract/ai/super-admin-add-ai-model.request.dto.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { defaultStringValidation } from "../validators/string.validator";
import { z } from "zod";

const defaultStringValidation = z
.string()
.transform((value) => value.trim())
.refine((value) => value.length >= 1, {
message: "Required",
});

export const SuperAdminAddAiModelRequestSchema = z.object({
chatLlmName: defaultStringValidation,
alias: z.string().optional(),
Expand Down
3 changes: 2 additions & 1 deletion packages/contract/rooms/create-room.request.dto.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { defaultStringValidation } from "../validators/string.validator";
import { z } from "zod";

export const CreateRoomRequestSchema = z.object({
Expand All @@ -10,7 +11,7 @@ export const CreateRoomRequestSchema = z.object({
.refine((value) => value.length <= 50, {
message: "Name must have at most 50 characters",
}),
aiModelId: z.string(),
aiModelId: defaultStringValidation,
isPrivate: z.boolean().default(false),
ownerId: z.string(),
});
8 changes: 8 additions & 0 deletions packages/contract/validators/string.validator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { z } from "zod";

export const defaultStringValidation = z
.string()
.transform((value) => value.trim())
.refine((value) => value.length >= 1, {
message: "Required",
});

0 comments on commit 8a14e56

Please sign in to comment.