-
Notifications
You must be signed in to change notification settings - Fork 3
CharacterGenerators
Typically in Pantella either you will prewrite characters and put them in the ./characters/ directory (See the section on writing character JSONs here). Certain models when used with certain inference engines can instead generate characters on the fly using a pydantic model as a schema.
This is a lot more loose in terms of layout compared to other modules in Pantella, but there are some standardized methods that you'll want to include in your character generator class. The methods are as follows:
-
get_prompt(character_name, **kwargs): This method should return a prompt that can be used to generate a character. This is typically used in the CLI to generate a character. Each game will likely have a unique prompt for generating a character and set of unique kwargs that are required for generating a character. For Skyrim, the kwargs arecharacter_ref_id,character_base_id,character_in_game_race,character_in_game_gender,character_is_guard,character_is_ghost, andlocation. -
get_character_info(ref_id, base_id, **kwargs): When a character is generated, they're applied with the Character class. This method is to take the character information generated and output it as an object that can be loaded into a character_manager and exported to the./characters/directory.
There is an example of a character generator in the ./src/character_generators/ directory called skyrim_pantella.py. This is a simple character generator that generates a Skyrim character. The character generator has a Character class that is a pydantic model that defines the schema for the character.