File size: 3,874 Bytes
d26f541
 
 
 
5b91336
d26f541
 
 
 
 
 
 
 
 
5b91336
 
d26f541
 
 
 
 
 
 
 
 
d35e9ec
 
d26f541
 
d35e9ec
d26f541
 
 
 
 
 
 
 
8614f30
 
 
 
f263c36
 
 
 
 
 
 
 
d35e9ec
 
 
 
 
 
 
 
 
 
 
d26f541
 
 
 
 
 
 
d35e9ec
 
 
 
 
 
 
 
 
d26f541
 
734573d
d26f541
 
87db41c
d26f541
 
f263c36
9c04855
d26f541
75959de
 
 
d35e9ec
8614f30
f263c36
 
75959de
 
8614f30
 
f263c36
 
 
 
d35e9ec
 
 
 
 
 
75959de
 
 
 
 
 
 
 
 
4bf2ebe
 
 
 
 
 
 
 
 
75959de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
export interface Question {
  uuid: string;
  id: string;
  category: string;
  domain?: string; // Optional, can be null
  question: string;
  theme?: string; // Optional, can be null
}

export interface Response {
  uuid: string;
  q_uuid: string; // Foreign key to Question
  model?: string;
  timestamp?: string; // ISO date string
  api_provider?: string; // Optional, can be null
  provider?: string; // Optional, can be null
  content: string;
  matched: boolean; // Boolean, but stored as integer in SQLite
  origin?: string; // Optional, can be null
}

export interface Assessment {
  uuid: string;
  q_uuid: string; // Foreign key to Question
  r_uuid: string; // Foreign key to Response
  judge: string; // Model used for assessment
  judge_type: string; // LLM or Human
  judge_analysis?: string; // Optional, can be null
  compliance: string; // Compliance status
  pitti_compliance?: string; // Optional, can be null
  origin?: string; // Optional, can be null
}

export interface Theme {
  slug: string; // Unique identifier for the theme
  name: string; // Human-readable name for the theme
}

export interface Model {
  model:string;
}

export interface ModelFamily {
  family:string;
}

export interface Provider {
  provider:string;
}

export interface Judges {
  name: string;
  judge_type: string; // human or LLM
  classifications: Record<string,number>
}

export interface SelectedJudge {
  name: string;
  classification: string;
}

export type TransitionMatrix = Record<string, Record<string, number>>;

interface JudgeAssessment{
  judge_analysis: string;
  compliance: string;
}

export interface PaginationProps {
  currentPage: number;
  totalPages: number;
  pageInput: string;
  handlePageInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  handlePageJump: (e: React.KeyboardEvent<HTMLInputElement>) => void;
  setCurrentPage: React.Dispatch<React.SetStateAction<number>>;
}

export interface AssessmentItem {
  question: string;
  q_uuid: string;
  theme: string;
  domain: string;
  r_uuid: string; 
  response: string;
  model: string;
  provider: string;
  assessments: Record<string,JudgeAssessment>;
}

export interface FilterBarProps {
  themes: Theme[];
  judges: Judges[];
  models: Model[];
  modelFamilies: ModelFamily[];
  providers: Provider[];
  selectedTheme: string;
  onThemeChange: (value: string) => void;
  selectedModel: string;
  onModelChange: (value: string) => void;
  selectedModelFamily: string;
  onModelFamilyChange: (value: string) => void;
  selectedProvider: string;
  onProviderChange: (value: string) => void;
  selectedJudge1: SelectedJudge | null;
  selectedJudge2: SelectedJudge | null;
  onJudge1NameChange : (value: string) => void;
  onJudge1ClassificationChange : (value: string) => void;
  onJudge2NameChange : (value: string) => void;
  onJudge2ClassificationChange : (value: string) => void;
}

export interface AssessmentItemsProps {
  judge1: string;
  judge2: string;
  items: AssessmentItem[];
  selectedCategory: string[] | null;
}

export interface AssessmentItemProps {
  item: AssessmentItem;
  judge1: string | null;
  judge2: string | null;
  isSelected: boolean;
  selectedAssessment: string | null; // e.g., 'COMPLETE', 'EVASIVE'
  onSelect: (r_uuid: string, buttonValue: string) => void;
}

export interface Segment {
  category_label: string;
  value: number;
  fromCategory?: string; // Optional for flow bars
}

export interface PlotStage {
  stage_name: string;
  segments: Segment[];
}

export interface HeatmapProps {
  matrix: TransitionMatrix;
  judge1: string;
  judge2: string;
  onCellClick: (fromCategory: string, toCategory: string) => void;
}

export interface WaterfallProps {
  matrix: TransitionMatrix;
  judge1: string;
  judge2: string;
  onCellClick: (fromCategory: string, toCategory: string) => void;
}

export interface ApiError {
  error: string;
}