Skip to content

chat_partner_builder

Provides a set of functions and data structures for generating synthetic chat partners via heuristics.

This module allows you to generate synthetic chat partners based on various characteristics such as age range, cognitive style, communication style, tech savviness, social media usage, political leaning, religious beliefs, interpersonal skills, hobbies, and dietary preferences. It provides a flexible framework for creating diverse chat partners for testing, research, or other purposes.

Example
chat_partner = generate_chat_partner(age_range="Teenager", cognitive_style="analytical", communication_style="assertive")
print(chat_partner)

Attributes

AgeRangeType module-attribute

AgeRangeType = Literal[
    "Newborn",
    "Toddler",
    "Preschooler",
    "Early Childhood",
    "Middle Childhood",
    "Preteen",
    "Teenager",
    "Young Adult",
    "Adult",
    "Middle-Aged Adult",
    "Senior Adult",
    "Elderly",
]

COGNITIVE_STYLE_DESC module-attribute

COGNITIVE_STYLE_DESC = "The manner in which an individual processes information, thinks, and approaches problem-solving. It encompasses their unique approach to reasoning, creativity, organization, and adaptability, reflecting their thought processes and intellectual preferences. Cognitive styles may evolve with age, influencing how individuals perceive and engage with the world around them"

COMMUNICATION_STYLE_DESC module-attribute

COMMUNICATION_STYLE_DESC = "The manner in which an individual communicates, conveying their unique approach to expressing thoughts and emotions."

CognitiveStyleType module-attribute

CognitiveStyleType = Literal[
    "simple",
    "analytical",
    "creative",
    "casual",
    "organized",
]

CommunicationStyleType module-attribute

CommunicationStyleType = Literal[
    "simple",
    "assertive",
    "emotive",
    "informal",
    "formal",
    "verbose",
    "rude",
    "abusive",
    "none",
]

DIETARY_PREFERENCES_DESC module-attribute

DIETARY_PREFERENCES_DESC = "The dietary preferences of an individual, encompassing their dietary restrictions and preferences."

DietaryPreferencesType module-attribute

DietaryPreferencesType = Literal[
    "vegan", "vegetarian", "none"
]

EDUCATION_LEVEL_DESC module-attribute

EDUCATION_LEVEL_DESC = ''

EducationLevelType module-attribute

EducationLevelType = Literal[
    "none",
    "currently in public school",
    "currently in private school",
    "did not finish high school",
    "completed GED",
    "completed high school",
    "completed trade school",
    "completed bachelors degree",
    "completed masters degree",
    "completed PhD",
]

FAMILY_DESC module-attribute

FAMILY_DESC = "The fitness routine of an individual, encompassing their exercise habits and preferences."

FITNESS_ROUTINE_DESC module-attribute

FITNESS_ROUTINE_DESC = "The fitness routine of an individual, encompassing their exercise habits and preferences."

FamilyType module-attribute

FamilyType = Literal[
    "living with both parents",
    "living in single-parent situation",
    "living in foster care",
    "single no kids",
    "single parent",
    "married no kids",
    "married parent",
    "divorced no kids",
    "divorced parent",
    "separated no kids",
    "separated parent",
]

FitnessRoutineType module-attribute

FitnessRoutineType = Literal[
    "none", "occasional", "regular"
]

HOBBIES_DESC module-attribute

HOBBIES_DESC = "The hobbies and interests of an individual, encompassing their recreational activities and pursuits."

HobbiesType module-attribute

HobbiesType = Literal[
    "3d printing",
    "aerobics",
    "animation",
    "archery",
    "astronomy",
    "baking",
    "baking",
    "beatboxing",
    "biking",
    "bird watching",
    "blogging",
    "board games",
    "book clubs",
    "boxing",
    "calligraphy",
    "candle making",
    "canoeing",
    "chess",
    "collecting (stamps, coins, etc.)",
    "community service",
    "cooking",
    "crafting",
    "creative writing",
    "crocheting",
    "cross-country skiing",
    "dance (various styles)",
    "dance",
    "darts",
    "digital art",
    "digital music production",
    "drawing",
    "drone racing",
    "electronic sports (esports)",
    "environmental activism",
    "escape rooms",
    "fencing",
    "fishing",
    "foraging",
    "game development",
    "gardening",
    "genealogy",
    "geocaching",
    "glassblowing",
    "golf",
    "graphic design",
    "hackathons",
    "hang gliding",
    "hiking",
    "historical reenactment",
    "home brewing",
    "home decoration",
    "horseback riding",
    "ice climbing",
    "ice fishing",
    "ice skating",
    "jewelry making",
    "kayaking",
    "kite flying",
    "knitting",
    "language learning",
    "larping (live action role playing)",
    "leather working",
    "light woodworking",
    "listening to music",
    "magic and illusion",
    "magic tricks",
    "marathon training",
    "martial arts",
    "meditation",
    "metal detecting",
    "model building",
    "model railroading",
    "mountain biking",
    "nature walks",
    "origami",
    "painting",
    "paragliding",
    "parkour",
    "photography editing",
    "photography",
    "pilates",
    "play-dough",
    "playing a musical instrument",
    "podcasting",
    "poetry writing",
    "pottery",
    "programming",
    "puzzles",
    "quilting",
    "radio hosting",
    "rc vehicles (cars, boats, planes)",
    "reading",
    "restoring furniture",
    "robotics",
    "rock climbing",
    "rock collecting",
    "rollerblading",
    "running",
    "sailing",
    "scrapbooking",
    "scuba diving",
    "sewing",
    "simple baking",
    "simple board games",
    "simple crafting",
    "simple gardening",
    "simple model building",
    "simple painting",
    "simple robotics",
    "singing",
    "skateboarding",
    "skiing",
    "skydiving",
    "snorkeling",
    "snowboarding",
    "snowshoeing",
    "soap making",
    "stand-up comedy",
    "star gazing",
    "sudoku",
    "surfing",
    "swimming",
    "tabletop role-playing games",
    "tai chi",
    "tea tasting",
    "theater (acting, directing)",
    "theater appreciation",
    "traveling",
    "triathlon training",
    "urban exploration",
    "urban gardening",
    "video gaming",
    "video production",
    "volunteering",
    "walking",
    "watching movies",
    "website development",
    "whittling",
    "wildlife photography",
    "wine making",
    "woodworking",
    "writing",
    "yacht racing",
    "yo-yo",
    "yoga",
    "zumba",
    "none",
]

INTERPERSONAL_SKILLS_DESC module-attribute

INTERPERSONAL_SKILLS_DESC = "The manner in which an individual interacts with others, encompassing their ability to communicate, collaborate, and resolve conflict."

InterpersonalSkillsType module-attribute

InterpersonalSkillsType = Literal[
    "active-listener",
    "aloof",
    "assertive",
    "attentive",
    "charismatic",
    "collaborative",
    "compassionate",
    "confrontational",
    "curious",
    "dependable",
    "diplomatic",
    "discouraging",
    "disrespectful",
    "empathetic",
    "encouraging",
    "flexible",
    "honest",
    "impatient",
    "insensitive",
    "intransigence",
    "judgmental",
    "manipulative",
    "motivating",
    "negotiative",
    "open-minded",
    "patient",
    "persuasive",
    "provocative",
    "respectful",
    "rigid",
    "stubborn",
    "tactful",
    "uncooperative",
    "understanding",
    "none",
]

POLITICAL_LEANING_DESC module-attribute

POLITICAL_LEANING_DESC = "The political alignment or ideology of an individual, representing their beliefs and views on political issues."

PoliticalLeaningType module-attribute

PoliticalLeaningType = Literal[
    "left", "center", "right", "none"
]

RELIGIOUS_BELIEFS_DESC module-attribute

RELIGIOUS_BELIEFS_DESC = "The religious beliefs or faith system of an individual, encompassing their adherence to specific religious traditions or their lack of religious belief."

ReligiousBeliefsType module-attribute

ReligiousBeliefsType = Literal[
    "christianity",
    "islam",
    "judaism",
    "buddhism",
    "hinduism",
    "atheist",
    "none",
]

SOCIAL_MEDIA_DESC module-attribute

SOCIAL_MEDIA_DESC = "The extent to which an individual engages with and utilizes social media platforms and online networking."

SocialMediaUsageType module-attribute

SocialMediaUsageType = Literal[
    "high", "medium", "low", "none"
]

TECH_SAVVINESS_DESC module-attribute

TECH_SAVVINESS_DESC = "The level of technological proficiency and familiarity exhibited by an individual, encompassing their comfort and competence with digital technologies."

TechSavvinessType module-attribute

TechSavvinessType = Literal["high", "medium", "low", "none"]

VicesType module-attribute

VicesType = Literal[
    "aggressiveness",
    "cynicism",
    "dishonesty",
    "envy",
    "excessive drinking",
    "excessive gaming",
    "excessive use of social media",
    "gambling",
    "gluttony (excessive indulgence)",
    "gossiping",
    "hoarding",
    "hypocrisy",
    "impatience",
    "impulsiveness",
    "indifference",
    "ingratitude",
    "insensitivity",
    "intolerance",
    "irresponsibility",
    "jealousy",
    "lack of empathy",
    "laziness",
    "materialism",
    "narcissism",
    "neglecting health",
    "obsessiveness",
    "overeating",
    "overspending",
    "overworking",
    "perfectionism",
    "pessimism",
    "prejudice",
    "procrastination",
    "recklessness",
    "sarcasm",
    "selfishness",
    "sloth (extreme laziness)",
    "smoking",
    "stubbornness",
    "vanity",
    "none",
]

Classes

ChatPartnerBuilder

Bases: BaseModel

Heuristics-based fake chat partner

Attributes

age instance-attribute
age: int
age_range instance-attribute
age_range: AgeRangeType
cognitive_style instance-attribute
cognitive_style: CognitiveStyleType
communication_style instance-attribute
communication_style: CommunicationStyleType
dietary_preferences instance-attribute
dietary_preferences: DietaryPreferencesType
disposition instance-attribute
disposition: Literal['good', 'bad']
education_level instance-attribute
education_level: EducationLevelType
family instance-attribute
family: FamilyType
fitness_routine instance-attribute
fitness_routine: FitnessRoutineType
hobbies instance-attribute
hobbies: List[HobbiesType]
interpersonal_skills instance-attribute
interpersonal_skills: InterpersonalSkillsType
name instance-attribute
name: str
political_leaning instance-attribute
political_leaning: PoliticalLeaningType
profession instance-attribute
profession: str
religious_beliefs instance-attribute
religious_beliefs: ReligiousBeliefsType
sex instance-attribute
sex: str
social_media_usage instance-attribute
social_media_usage: SocialMediaUsageType
tech_savviness instance-attribute
tech_savviness: TechSavvinessType
vices instance-attribute
vices: List[VicesType]

Functions

generate classmethod
generate(
    num_hobbies=3, num_vices=2, age_min=5, age_max=85
) -> ChatPartnerBuilder

Generate a fake chat partner

prompt
prompt() -> str

Functions

get_age_range

get_age_range(age: int) -> AgeRangeType

Returns the age range based on the given age.

Parameters:

  • age (int) –

    The age to determine the age range for.

Returns:

  • AgeRangeType ( AgeRangeType ) –

    The age range corresponding to the given age.

Raises:

  • ValueError

    If the given age is invalid.

meets_age_requirements

meets_age_requirements(
    age: int,
    min_age_range: AgeRangeType,
    max_age_range: AgeRangeType = "Elderly",
) -> bool

Check if the given age meets the specified age requirements.

Parameters:

  • age (int) –

    The age to be checked.

  • min_age_range (AgeRangeType) –

    The minimum age range to be considered.

  • max_age_range (AgeRangeType, default: 'Elderly' ) –

    The maximum age range to be considered. Defaults to “Elderly”.

Returns:

  • bool ( bool ) –

    True if the age meets the requirements, False otherwise.