Skip to main content

Generator Agents API

Generators create synthetic character files (profiles) for use with client agents.

Available Generators

GeneratorKeyDescription
AnnaAgent GeneratorannaAgentMulti-session profiles with scales and memory states
ClientCast GeneratorclientCastProfiles from conversation excerpts via Big Five + clinical scales
Psyche GeneratorpsycheMFC psychiatric profiles for assessment training

Listing Available Generators

from patienthub.generators import GENERATORS, GENERATOR_CONFIG_REGISTRY

# List all generator types
print("Available generators:", list(GENERATORS.keys()))

# Get config class for a generator
config_class = GENERATOR_CONFIG_REGISTRY['psyche']
print(config_class)

Loading a Generator

from patienthub.generators import get_generator

generator = get_generator(agent_name='psyche', lang='en')

Loading a Generator with Custom Configuration

from omegaconf import OmegaConf
from patienthub.generators import get_generator

config = OmegaConf.create({
'agent_name': 'psyche',
'model_type': 'OPENAI',
'model_name': 'gpt-4o',
'temperature': 0.7,
'max_tokens': 8192,
'max_retries': 3,
'prompt_path': 'data/prompts/generator/psyche.yaml',
'input_dir': 'data/resources/psyche_character.json',
'output_dir': 'data/characters/Psyche MFC.json',
})

generator = get_generator(agent_name='psyche', configs=config, lang='en')

Generating a Character

All generators expose a single generate_character() method that runs the full pipeline and saves the result to output_dir:

generator.generate_character()

Configuration Options

Common Options

OptionTypeDefaultDescription
agent_namestrrequiredGenerator identifier
model_typestr"OPENAI"Model provider key (used to read ${MODEL_TYPE}_API_KEY / ${MODEL_TYPE}_BASE_URL)
model_namestr"gpt-4o"Model identifier
temperaturefloat0.7Sampling temperature (0-1)
max_tokensint8192Max response tokens
max_retriesint3API retry attempts
prompt_pathstrvariesPath to generator prompts
input_dirstrvariesPath to input data / seed file
output_dirstrvariesPath where the generated character JSON is saved
langstr"en"Language code

See Also