-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a45c7e
commit 6329e1a
Showing
9 changed files
with
71 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,8 @@ | |
"routes/": "./routes/", | ||
"tailwindcss": "npm:[email protected]", | ||
"tailwindcss/": "npm:/[email protected]/", | ||
"tailwindcss/plugin": "npm:/[email protected]/plugin.js" | ||
"tailwindcss/plugin": "npm:/[email protected]/plugin.js", | ||
"zod": "https://deno.land/x/[email protected]/mod.ts" | ||
}, | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { type VoiceType } from "routes/api/voicesynth.tsx"; | ||
import { z } from "zod"; | ||
|
||
export const MIN_AGENTS = 2; | ||
export const MAX_AGENTS = 4; | ||
export const MAX_DEBATE_CONTEXT_LENGTH = 1028; | ||
export const MIN_DEBATE_ROUNDS = 1; | ||
export const MAX_DEBATE_ROUNDS = 3; | ||
export const MAX_NAME_LENGTH = 32; | ||
export const MAX_POSITION_LENGTH = 256; | ||
export const MAX_PERSONALITY_LENGTH = 256; | ||
|
||
export const AgentDetailsSchema = z.object({ | ||
name: z.string().min(1).max(MAX_NAME_LENGTH), | ||
personality: z.string().min(1).max(MAX_PERSONALITY_LENGTH), | ||
stance: z.enum(["for", "against", "undecided", "moderator"]), | ||
voice: z.enum([z.custom<VoiceType>()]), | ||
}); | ||
|
||
export const DebateRequestSchema = z.object({ | ||
position: z.string().min(1).max(MAX_POSITION_LENGTH), | ||
context: z.string().max(MAX_DEBATE_CONTEXT_LENGTH).default(""), | ||
numAgents: z.number().int().min(MIN_AGENTS).max(MAX_AGENTS), | ||
agentDetails: z.array(AgentDetailsSchema), | ||
uuid: z.string().uuid(), | ||
numDebateRounds: z.number().int().min(MIN_DEBATE_ROUNDS).max(MAX_DEBATE_ROUNDS), | ||
moderatorVoice: z.union([z.enum(["none"]), z.custom<VoiceType>()]), | ||
}).refine(data => data.agentDetails.length === data.numAgents, { | ||
message: "Number of agent details must match numAgents", | ||
path: ["agentDetails"], | ||
}); | ||
|
||
export type AgentDetails = z.infer<typeof AgentDetailsSchema>; | ||
export type DebateRequest = z.infer<typeof DebateRequestSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters