The specification version ("v1", "v2", or "v3") to clone the character card into. Defaults to "v3" if not specified.
A new CharacterCard instance formatted according to the specified version.
Returns the maximum compatible version of the character card
this card => merge(v1,v2,v3);
Converts the current character card data to the SpecV1 format.
This method constructs a SpecV1.TavernCard object by extracting the necessary fields from the current instance's raw data using a getter function. The function retrieves data from multiple sources, including instance properties, the raw data object, and its nested data object. The resulting object contains fields defined in the chara_card_v1 specification, such as name, description, personality, scenario, first message, and example messages.
A SpecV1.TavernCard object representing the character card data in SpecV1 format.
Converts the current character card data to the SpecV2 format.
This method constructs a SpecV2.TavernCardV2 object by extracting the necessary fields from the current instance's raw data using a getter function. The function retrieves data from multiple sources, including instance properties, the raw data object, and its nested data object. The resulting object contains fields defined in the chara_card_v2 specification, including additional fields introduced in later updates.
A deep-cloned SpecV2.TavernCardV2 object representing the character card data in SpecV2 format.
Converts the current character card data to the SpecV3 format.
This function utilizes a getter to retrieve properties from the character card's raw data and returns a deep-cloned object conforming to the SpecV3.CharacterCardV3 structure. It includes fields from the CCV2 specification, changes specific to CCV3, and new fields introduced in CCV3.
A deep-cloned object representing the character card data in SpecV3 format.
Static
from_Static
from_Static
parse_
Creates a clone of the current CharacterCard instance in the specified version format.
This method generates a new CharacterCard object with the data formatted to match the specified version's specification. It supports conversion to SpecV1, SpecV2, and SpecV3 formats by utilizing the respective
toSpecV1
,toSpecV2
, andtoSpecV3
methods.