ExtrasFormatter

Provides the ExtrasFormatter singleton used by the SDAI presentation layer.

Author

Dmitriy Moroz

Functions

Link copied to clipboard

Determines the type of extra based on the input string.

Link copied to clipboard

Checks if a specific embedding is present in the given prompt.

Link copied to clipboard
fun isExtraPresentInPrompt(prompt: String, loraAlias: String, type: ExtraType = ExtraType.Lora): Boolean

Checks if a specific extra is present in the given prompt.

Link copied to clipboard
fun isExtraWithValuePresentInPrompt(prompt: String, loraAlias: String, type: ExtraType = ExtraType.Lora): Pair<Boolean, String?>

Checks if a specific extra with its value is present in the given prompt.

Link copied to clipboard
fun toggleEmbedding(prompt: String, embedding: String): String

Toggles the presence of a specific embedding in the given prompt string.

Link copied to clipboard
fun toggleExtraPromptAlias(prompt: String, loraAlias: String, type: ExtraType = ExtraType.Lora): String

Toggles the presence of a specific extra prompt alias in the given prompt string.