Build a fixed text query without PaperFlow lexicon expansion.
(user_meta: Dict[str, Any], role: Dict[str, Any])
| 192 | |
| 193 | |
| 194 | def build_query_profile(user_meta: Dict[str, Any], role: Dict[str, Any]) -> Dict[str, Any]: |
| 195 | """Build a fixed text query without PaperFlow lexicon expansion.""" |
| 196 | description = str(user_meta.get("description") or role.get("description") or "").strip() |
| 197 | bootstrap_summary = str(role.get("bootstrap_summary") or "").strip() |
| 198 | directions = dedupe_strings( |
| 199 | seed_direction_phrases(user_meta.get("seed_directions")) |
| 200 | + seed_direction_phrases(role.get("seed_directions")) |
| 201 | + seed_direction_phrases(role.get("core_directions")) |
| 202 | ) |
| 203 | parts = [ |
| 204 | description, |
| 205 | bootstrap_summary if bootstrap_summary != description else "", |
| 206 | " ".join(directions), |
| 207 | ] |
| 208 | query_text = " ".join(part for part in parts if part).strip() |
| 209 | return { |
| 210 | "query_text": query_text, |
| 211 | "directions": directions, |
| 212 | "description": description, |
| 213 | } |
| 214 | |
| 215 | |
| 216 | def build_profile_map( |
no test coverage detected