-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtypes.ts
More file actions
83 lines (72 loc) · 2.21 KB
/
types.ts
File metadata and controls
83 lines (72 loc) · 2.21 KB
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
import type { Content } from '@google/genai';
export enum MessageSender {
USER = 'user',
AI = 'ai',
SYSTEM = 'system',
}
export interface ChatMessage {
id: string;
sender: MessageSender;
text: string;
timestamp: Date;
audio?: string; // Adicionado para suportar áudio opcional
sources?: { uri: string; title: string }[];
rawResponse?: any; // Resposta bruta do backend
error?: string; // Erro de backend ou rede
}
export interface SwotAnalysis {
forças?: string;
fraquezas?: string;
oportunidades?: string;
ameaças?: string;
[key: string]: string | undefined; // To allow dynamic assignment
}
export interface UploadedDocument {
id: string;
name: string;
text: string;
file: File;
summary?: string;
insights?: string;
swot?: SwotAnalysis;
processingAnalysis?: boolean;
analysisError?: string | null;
}
export interface PredefinedBook {
id: string;
name: string;
description: string;
folderName: string;
fileName: string; // e.g., 'content.txt' or 'structured_data.json'
}
export interface RagDataItem {
documentName: string; // For user docs, it's file.name. For books, it's book.name.
content: string;
sourceType: 'user_document' | 'internal_book';
bookId?: string; // id of the PredefinedBook if sourceType is 'internal_book'
summary?: string; // Only applicable for user_document now
insights?: string; // Only applicable for user_document now
swot?: SwotAnalysis; // Only applicable for user_document now
}
export type RagData = RagDataItem[];
export type ComparisonSource = 'uploadedDoc' | 'lastAiResponse' | null;
export type GeminiHistoryPart = Content; // Content is { role: string, parts: Part[] }
export interface LegalAgent {
id: string;
name: string;
description: string;
systemInstruction: string;
}
// Type for the structured content of cf88_structured.json
export interface CF88Chunk {
tipo: string;
numero_romano?: string;
numero?: string;
caput?: string;
texto?: string; // For sections or general text not in caput
pagina: number;
filhos?: CF88Chunk[];
incisos?: CF88Chunk[]; // Assuming incisos can also have text
paragrafos?: CF88Chunk[]; // Assuming paragrafos can also have text
// Add other potential fields if necessary
}