Skip to content

Commit d40ffb5

Browse files
committed
Update PDF chunker and entity extraction
1 parent 3fa4b06 commit d40ffb5

File tree

15 files changed

+1875
-1376
lines changed

15 files changed

+1875
-1376
lines changed

ai/generative-ai-service/complex-document-rag/README.md

Lines changed: 179 additions & 200 deletions
Large diffs are not rendered by default.

ai/generative-ai-service/complex-document-rag/files/agents/agent_factory.py

Lines changed: 200 additions & 216 deletions
Large diffs are not rendered by default.

ai/generative-ai-service/complex-document-rag/files/agents/report_writer_agent.py

Lines changed: 424 additions & 362 deletions
Large diffs are not rendered by default.

ai/generative-ai-service/complex-document-rag/files/gradio.css

Lines changed: 161 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/* ===== CLEAN LIGHT THEME ===== */
22
:root {
3-
--primary-color: #ff6b35;
4-
--secondary-color: #6c757d;
5-
--background-color: #ffffff;
6-
--surface-color: #ffffff;
3+
--primary-color: #c74634;
4+
--oracle-red: #c74634;
5+
--secondary-color: #6f757e;
6+
--background-color: #fffefe;
7+
--surface-color: #fffefe;
8+
--off-white: #fffefe;
79
--border-color: #dee2e6;
8-
--text-color: #212529;
9-
--text-muted: #6c757d;
10+
--text-color: #312d2a;
11+
--text-muted: #6f7572;
12+
--dark-grey: #404040;
1013
}
1114

1215
/* ===== GLOBAL STYLING ===== */
@@ -36,7 +39,7 @@
3639

3740
/* ===== BUTTONS ===== */
3841
.gr-button, button, .primary-button, .secondary-button {
39-
background: white !important;
42+
background: var(--off-white) !important;
4043
color: var(--primary-color) !important;
4144
border: 1px solid var(--primary-color) !important;
4245
padding: 10px 20px !important;
@@ -46,43 +49,95 @@
4649
letter-spacing: 0.5px !important;
4750
cursor: pointer !important;
4851
font-size: 12px !important;
49-
transition: color 0.2s ease !important;
52+
transition: background-color 0.2s ease, color 0.2s ease !important;
5053
}
5154

5255
.gr-button:hover, button:hover, .primary-button:hover, .secondary-button:hover {
5356
background: #f8f8f8 !important;
5457
color: var(--primary-color) !important;
58+
padding: 10px 20px !important; /* Keep same padding to prevent jumpy behavior */
5559
}
5660

5761
.gr-button:active, button:active, .primary-button:active, .secondary-button:active {
5862
background: #f0f0f0 !important;
5963
color: var(--primary-color) !important;
64+
padding: 10px 20px !important; /* Keep same padding to prevent jumpy behavior */
6065
}
6166

6267
/* ===== TABS ===== */
63-
.gr-tabs .gr-tab-nav button {
64-
background: #6c757d !important;
65-
color: white !important;
68+
/* Target all possible tab button selectors for Gradio */
69+
.gr-tabs .tab-nav button,
70+
.gr-tabs .gr-tab-nav button,
71+
div[role="tablist"] button,
72+
button[role="tab"],
73+
.gradio-container .gr-tabs button[role="tab"],
74+
.gradio-container button.tab-nav-button {
75+
background: #c74634 !important;
76+
background-color: #c74634 !important;
77+
color: #fffefe !important;
6678
border: none !important;
79+
border-bottom: 3px solid transparent !important; /* Remove orange underline */
6780
padding: 12px 20px !important;
6881
font-weight: 500 !important;
6982
text-transform: uppercase !important;
7083
letter-spacing: 0.5px !important;
7184
border-radius: 4px 4px 0 0 !important;
7285
margin-right: 2px !important;
73-
}
74-
75-
.gr-tabs .gr-tab-nav button.selected {
76-
background: #495057 !important;
77-
}
78-
79-
.gr-tabs .gr-tab-nav button:hover {
80-
background: #5a6268 !important;
86+
transition: background-color 0.3s ease, border-bottom 0.3s ease !important;
87+
opacity: 0.8 !important;
88+
}
89+
90+
/* Selected/Active tab with black underline */
91+
.gr-tabs .tab-nav button.selected,
92+
.gr-tabs .gr-tab-nav button.selected,
93+
div[role="tablist"] button.selected,
94+
button[role="tab"][aria-selected="true"],
95+
button[role="tab"].selected,
96+
.gradio-container .gr-tabs button[role="tab"].selected,
97+
.gradio-container button.tab-nav-button.selected {
98+
background: #c74634 !important;
99+
background-color: #c74634 !important;
100+
opacity: 1 !important;
101+
color: #fffefe !important;
102+
font-weight: 500 !important; /* Keep same weight as non-selected to prevent jumpy behavior */
103+
border-bottom: 3px solid #312d2a !important; /* Black underline for active tab */
104+
padding: 12px 20px !important; /* Keep same padding */
105+
}
106+
107+
/* Hover state for non-selected tabs */
108+
.gr-tabs .tab-nav button:hover:not(.selected),
109+
.gr-tabs .gr-tab-nav button:hover:not(.selected),
110+
div[role="tablist"] button:hover:not(.selected),
111+
button[role="tab"]:hover:not([aria-selected="true"]),
112+
button[role="tab"]:hover:not(.selected),
113+
.gradio-container .gr-tabs button[role="tab"]:hover:not(.selected),
114+
.gradio-container button.tab-nav-button:hover:not(.selected) {
115+
background: #404040 !important;
116+
background-color: #404040 !important;
117+
color: #fffefe !important;
118+
opacity: 1 !important;
119+
padding: 12px 20px !important; /* Keep same padding */
120+
}
121+
122+
/* Additional override for any nested spans or text elements in tabs */
123+
.gr-tabs button span,
124+
button[role="tab"] span,
125+
.gr-tabs button *,
126+
button[role="tab"] * {
127+
color: inherit !important;
128+
}
129+
130+
/* Remove any orange borders/underlines that might appear */
131+
button[role="tab"]::after,
132+
button[role="tab"]::before,
133+
.gr-tabs button::after,
134+
.gr-tabs button::before {
135+
display: none !important;
81136
}
82137

83138
/* ===== COMPACT UPLOAD SECTIONS ===== */
84139
.upload-section {
85-
background: white !important;
140+
background: var(--off-white) !important;
86141
border: 1px solid var(--border-color) !important;
87142
border-radius: 8px !important;
88143
padding: 12px !important;
@@ -113,44 +168,51 @@
113168
margin: 8px 0 !important;
114169
display: block !important;
115170
padding: 12px !important;
116-
background: white !important;
171+
background: var(--off-white) !important;
117172
border: 1px solid var(--primary-color) !important;
118173
}
119174

120175
/* ===== INFERENCE LAYOUT ===== */
121176
.inference-left-column, .inference-right-column {
122-
background: white !important;
177+
background: var(--off-white) !important;
123178
padding: 20px !important;
124179
}
125180

126181
.query-section {
127182
margin-bottom: 16px !important;
128183
}
129184

130-
.model-controls, .collection-controls {
131-
background: white !important;
185+
/* Make control sections more compact */
186+
.model-controls, .collection-controls, .processing-controls {
187+
background: var(--off-white) !important;
132188
border: 1px solid var(--border-color) !important;
133189
border-radius: 6px !important;
134-
padding: 12px !important;
135-
margin-bottom: 12px !important;
190+
padding: 8px !important; /* Reduced padding for compactness */
191+
margin-bottom: 8px !important; /* Reduced margin */
136192
}
137193

138194
.processing-controls {
139-
background: white !important;
140195
border: 1px solid var(--primary-color) !important;
141-
border-radius: 6px !important;
142-
padding: 12px !important;
143-
margin-bottom: 12px !important;
144196
}
145197

146-
.compact-query textarea {
147-
min-height: 120px !important;
148-
max-height: 150px !important;
198+
/* Compact headers in control sections */
199+
.model-controls h4,
200+
.collection-controls h4,
201+
.processing-controls h4 {
202+
font-size: 12px !important;
203+
margin-bottom: 4px !important;
204+
}
205+
206+
/* Make query textarea much larger */
207+
.compact-query textarea,
208+
.query-section textarea {
209+
min-height: 360px !important; /* 3x larger than before */
210+
max-height: 450px !important;
149211
}
150212

151213
/* ===== INPUT FIELDS ===== */
152214
.gr-textbox, .gr-textbox textarea, .gr-textbox input {
153-
background: white !important;
215+
background: var(--off-white) !important;
154216
border: 1px solid var(--border-color) !important;
155217
border-radius: 4px !important;
156218
color: var(--text-color) !important;
@@ -159,15 +221,22 @@
159221

160222
/* ===== DROPDOWNS ===== */
161223
.gr-dropdown, .gr-dropdown select {
162-
background: white !important;
224+
background: var(--off-white) !important;
163225
border: 1px solid var(--border-color) !important;
164226
border-radius: 4px !important;
165227
color: var(--text-color) !important;
166228
}
167229

230+
/* Make dropdowns more compact */
231+
.model-controls .gr-dropdown,
232+
.collection-controls .gr-dropdown {
233+
padding: 6px !important;
234+
font-size: 13px !important;
235+
}
236+
168237
/* ===== FILE UPLOAD ===== */
169238
.gr-file {
170-
background: white !important;
239+
background: var(--off-white) !important;
171240
border: 2px dashed var(--primary-color) !important;
172241
border-radius: 8px !important;
173242
padding: 20px !important;
@@ -212,17 +281,68 @@
212281
display: none !important;
213282
}
214283

215-
/* ===== FORCE WHITE BACKGROUNDS ===== */
284+
/* ===== FORCE OFF-WHITE BACKGROUNDS ===== */
216285
.gr-group, .gr-form, .gr-block {
217-
background: white !important;
286+
background: var(--off-white) !important;
218287
}
219288

220289
/* ===== DELETE BUTTON ===== */
221290
.gr-button[variant="stop"] {
222-
background: #dc3545 !important;
223-
color: white !important;
291+
background: var(--oracle-red) !important;
292+
color: var(--off-white) !important;
293+
border: 1px solid var(--oracle-red) !important;
224294
}
225295

226296
.gr-button[variant="stop"]:hover {
227-
background: #c82333 !important;
297+
background: #a13527 !important;
298+
border: 1px solid #a13527 !important;
299+
}
300+
301+
/* ===== CHECKBOXES - MORE COMPACT ===== */
302+
.gr-checkbox-group {
303+
display: flex !important;
304+
gap: 12px !important;
305+
flex-wrap: wrap !important;
306+
}
307+
308+
.gr-checkbox-group label {
309+
font-size: 13px !important;
310+
margin-bottom: 0 !important;
311+
}
312+
313+
/* ===== COMPACT SETTINGS SECTION ===== */
314+
.compact-settings {
315+
background: var(--off-white) !important;
316+
border: 1px solid var(--border-color) !important;
317+
border-radius: 6px !important;
318+
padding: 8px !important;
319+
margin-top: 8px !important;
320+
}
321+
322+
.compact-settings .gr-row {
323+
margin-bottom: 4px !important;
324+
}
325+
326+
.compact-settings .gr-dropdown {
327+
margin-bottom: 4px !important;
328+
}
329+
330+
.compact-settings .gr-dropdown label {
331+
font-size: 12px !important;
332+
margin-bottom: 2px !important;
333+
}
334+
335+
.compact-settings .gr-checkbox {
336+
margin: 0 !important;
337+
padding: 4px !important;
338+
}
339+
340+
.compact-settings .gr-checkbox label {
341+
font-size: 12px !important;
342+
margin: 0 !important;
343+
}
344+
345+
/* Remove extra spacing in compact settings */
346+
.compact-settings > div {
347+
gap: 4px !important;
228348
}

0 commit comments

Comments
 (0)