![JAR search and dependency download from the Maven repository](/logo.png)
cc.unitmesh.prompt.model.PromptScript.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of prompt-script Show documentation
Show all versions of prompt-script Show documentation
Chocolate Factory is a cutting-edge LLM toolkit designed to empower you in creating your very own AI assistant.
package cc.unitmesh.prompt.model
import com.charleskorn.kaml.PolymorphismStyle
import com.charleskorn.kaml.Yaml
import com.charleskorn.kaml.YamlConfiguration
import kotlinx.serialization.Serializable
@Serializable
data class PromptScript(
val name: String,
val description: String,
val jobs: Map,
) {
companion object {
fun fromString(yamlString: String): PromptScript? {
return try {
val configuration = YamlConfiguration(polymorphismStyle = PolymorphismStyle.Property)
Yaml(
configuration = configuration,
).decodeFromString(serializer(), yamlString)
} catch (e: Exception) {
e.printStackTrace()
null
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy