|
|
| from __future__ import annotations
|
|
|
| from typing import Any, TypedDict
|
|
|
| from ui.intake.loader import load_demo_personas
|
| from ui.intake.prompts import build_profile_prompt
|
|
|
|
|
| class PersonaProfile(TypedDict):
|
| citizenship: list[str] | str
|
| current_country: str
|
| residence_status: str
|
| education: str
|
| occupation: str
|
| experience: str
|
| languages: list[str] | str
|
| budget: str
|
| family: str
|
| timeline: str
|
| goals: str
|
|
|
|
|
| class DemoPersona(TypedDict):
|
| id: str
|
| label: str
|
| profile: PersonaProfile
|
|
|
|
|
| def demo_personas() -> list[DemoPersona]:
|
| return load_demo_personas()
|
|
|
|
|
| def persona_prompt(profile: PersonaProfile | dict[str, Any]) -> dict[str, object]:
|
| return build_profile_prompt(
|
| profile.get("citizenship"),
|
| profile.get("current_country"),
|
| profile.get("residence_status"),
|
| profile.get("education"),
|
| profile.get("occupation"),
|
| profile.get("experience"),
|
| profile.get("languages"),
|
| profile.get("budget"),
|
| profile.get("family"),
|
| profile.get("timeline"),
|
| profile.get("goals", ""),
|
| )
|
|
|