|
174 | 174 |
|
175 | 175 | # --------------------------------------------------------------------------- |
176 | 176 | # summarize.prompty — first-pass thread summary |
| 177 | +# |
| 178 | +# Mirrors the 6-field shape the prompty actually instructs the model to emit |
| 179 | +# (see ``summarize.prompty`` lines ~69-88). Strict mode would silently drop |
| 180 | +# every field outside this list; the consumer in ``services/pipeline.py`` |
| 181 | +# reads ``parsed["overview"]`` and stores ``parsed`` whole under |
| 182 | +# ``metadata.structured_summary``, so the schema must carry the full shape. |
177 | 183 | # --------------------------------------------------------------------------- |
| 184 | +_SUMMARY_ACTION_ITEM = { |
| 185 | + "type": "object", |
| 186 | + "properties": { |
| 187 | + "owner": {"type": ["string", "null"]}, |
| 188 | + "task": {"type": "string"}, |
| 189 | + "deadline": {"type": ["string", "null"]}, |
| 190 | + }, |
| 191 | + "required": ["owner", "task", "deadline"], |
| 192 | + "additionalProperties": False, |
| 193 | +} |
| 194 | + |
178 | 195 | SUMMARIZE_SCHEMA: dict[str, Any] = { |
179 | 196 | "type": "object", |
180 | 197 | "properties": { |
181 | | - "summary": {"type": "string"}, |
| 198 | + "overview": {"type": "string"}, |
182 | 199 | "key_points": {"type": "array", "items": {"type": "string"}}, |
| 200 | + "decisions": {"type": "array", "items": {"type": "string"}}, |
| 201 | + "open_issues": {"type": "array", "items": {"type": "string"}}, |
| 202 | + "action_items": {"type": "array", "items": _SUMMARY_ACTION_ITEM}, |
183 | 203 | "topics": {"type": "array", "items": {"type": "string"}}, |
184 | 204 | }, |
185 | | - "required": ["summary", "key_points", "topics"], |
| 205 | + "required": [ |
| 206 | + "overview", |
| 207 | + "key_points", |
| 208 | + "decisions", |
| 209 | + "open_issues", |
| 210 | + "action_items", |
| 211 | + "topics", |
| 212 | + ], |
186 | 213 | "additionalProperties": False, |
187 | 214 | } |
188 | 215 |
|
189 | 216 |
|
190 | 217 | # --------------------------------------------------------------------------- |
191 | 218 | # summarize_update.prompty — incremental thread summary update |
| 219 | +# Same shape as the first-pass schema; both prompties emit the same payload. |
192 | 220 | # --------------------------------------------------------------------------- |
193 | 221 | SUMMARIZE_UPDATE_SCHEMA: dict[str, Any] = SUMMARIZE_SCHEMA |
194 | 222 |
|
195 | 223 |
|
196 | 224 | # --------------------------------------------------------------------------- |
197 | 225 | # user_summary.prompty — first-pass user profile |
| 226 | +# |
| 227 | +# Mirrors the 8 sections the prompty body documents (see |
| 228 | +# ``user_summary.prompty`` lines ~35-86 and the JSON example block). Each |
| 229 | +# section is a flat string array; the full ``parsed`` dict is persisted under |
| 230 | +# ``metadata.structured_summary`` and the ``content`` field is composed from |
| 231 | +# ``key_facts`` for vector retrieval. |
198 | 232 | # --------------------------------------------------------------------------- |
199 | 233 | USER_SUMMARY_SCHEMA: dict[str, Any] = { |
200 | 234 | "type": "object", |
201 | 235 | "properties": { |
202 | | - "summary": {"type": "string"}, |
203 | | - "key_attributes": {"type": "array", "items": {"type": "string"}}, |
| 236 | + "key_facts": {"type": "array", "items": {"type": "string"}}, |
| 237 | + "personal_preferences": {"type": "array", "items": {"type": "string"}}, |
| 238 | + "account_environment": {"type": "array", "items": {"type": "string"}}, |
| 239 | + "goals_current_work": {"type": "array", "items": {"type": "string"}}, |
| 240 | + "behavioral_patterns": {"type": "array", "items": {"type": "string"}}, |
| 241 | + "compliance_requirements": {"type": "array", "items": {"type": "string"}}, |
| 242 | + "open_items": {"type": "array", "items": {"type": "string"}}, |
204 | 243 | "topics": {"type": "array", "items": {"type": "string"}}, |
205 | 244 | }, |
206 | | - "required": ["summary", "key_attributes", "topics"], |
| 245 | + "required": [ |
| 246 | + "key_facts", |
| 247 | + "personal_preferences", |
| 248 | + "account_environment", |
| 249 | + "goals_current_work", |
| 250 | + "behavioral_patterns", |
| 251 | + "compliance_requirements", |
| 252 | + "open_items", |
| 253 | + "topics", |
| 254 | + ], |
207 | 255 | "additionalProperties": False, |
208 | 256 | } |
209 | 257 |
|
210 | 258 |
|
211 | 259 | # --------------------------------------------------------------------------- |
212 | 260 | # user_summary_update.prompty — incremental user profile update |
| 261 | +# Same shape as the first-pass schema. |
213 | 262 | # --------------------------------------------------------------------------- |
214 | 263 | USER_SUMMARY_UPDATE_SCHEMA: dict[str, Any] = USER_SUMMARY_SCHEMA |
215 | 264 |
|
|
0 commit comments