missing leading `{` when rendering JSON string
Closed this issue ยท 5 comments
Zane-XY commented
It seems the rendering logic has a bug when dealing with the following input:
val prompt = """
{
"model": "{{{model}}}",
}""".trimIndent()
val p = prompt.render(
mapOf( "model" to "staticValue1")
)
println(p)
The result prints:
"model": "staticValue1",
}
The leading {
is missing in the rendered result.
L-Briand commented
New version 1.0.2
should fix this issue. Can you please try ?
implementation("net.orandja.ktm:core:1.0.2")
Zane-XY commented
hi @L-Briand ,
i tried, it works for some cases, but not this one:
@Test
fun testMapContext() {
val prompt = """
{
"source":"{{{model}}}"
}
""".trimIndent()
val p = prompt.render(
mapOf( "model" to "staticValue1")
)
println(p)
}
}
L-Briand commented
The issue should be fixed in the 1.0.3 version