feat: add OpenRouter audit generation pipeline
This commit is contained in:
58
lib/ai/schemas.ts
Normal file
58
lib/ai/schemas.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const findingItemSchema = z.object({
|
||||
section: z.string(),
|
||||
finding: z.string(),
|
||||
suggestion: z.string(),
|
||||
});
|
||||
|
||||
export const internalFindingsSchema = z.object({
|
||||
findings: z.array(findingItemSchema),
|
||||
summary: z.string(),
|
||||
});
|
||||
|
||||
export const auditSummarySchema = z.object({
|
||||
summary: z.string(),
|
||||
keyFindings: z.array(z.string()),
|
||||
});
|
||||
|
||||
export const publicAuditTextSchema = z.object({
|
||||
publicText: z.string(),
|
||||
});
|
||||
|
||||
export const emailDraftSchema = z.object({
|
||||
body: z.string(),
|
||||
});
|
||||
|
||||
export const emailSubjectSchema = z.object({
|
||||
subject: z.string(),
|
||||
});
|
||||
|
||||
export const callScriptSchema = z.object({
|
||||
openingLine: z.string(),
|
||||
callScript: z.array(z.string()),
|
||||
closeLine: z.string(),
|
||||
});
|
||||
|
||||
export const followUpDraftSchema = z.object({
|
||||
message: z.string(),
|
||||
followInDays: z.number().int().min(0).optional(),
|
||||
goals: z.array(z.string()).optional(),
|
||||
});
|
||||
|
||||
export const qualityReviewSchema = z.object({
|
||||
isValid: z.boolean(),
|
||||
issues: z.array(z.string()),
|
||||
suggestions: z.array(z.string()),
|
||||
notes: z.array(z.string()).optional(),
|
||||
});
|
||||
|
||||
export type FindingItem = z.infer<typeof findingItemSchema>;
|
||||
export type InternalFindings = z.infer<typeof internalFindingsSchema>;
|
||||
export type AuditSummary = z.infer<typeof auditSummarySchema>;
|
||||
export type PublicAuditText = z.infer<typeof publicAuditTextSchema>;
|
||||
export type EmailDraft = z.infer<typeof emailDraftSchema>;
|
||||
export type EmailSubject = z.infer<typeof emailSubjectSchema>;
|
||||
export type CallScript = z.infer<typeof callScriptSchema>;
|
||||
export type FollowUpDraft = z.infer<typeof followUpDraftSchema>;
|
||||
export type QualityReview = z.infer<typeof qualityReviewSchema>;
|
||||
Reference in New Issue
Block a user