-
Notifications
You must be signed in to change notification settings - Fork 220
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
It seems to me like the JsonStructuredData
schema doesn't actually contain the annotated data from @LLMDescription
For example this is what the result is when serializing an annotated class:
@Serializable
@LLMDescription("A simple data class for testing serialization")
data class Hero(val name: String, val age: Int, @LLMDescription("The hero's superpower") val superpower: String)
test("Serializing simple data") {
val heroStructure =
JsonStructuredData.createJsonStructure<Hero>(
schemaFormat = JsonSchemaGenerator.SchemaFormat.Simple,
schemaType = JsonStructuredData.JsonSchemaType.SIMPLE,
)
expectSelfie(serialize.encodeToString(heroStructure.schema))
.toBe(
"""{
"type": "ai.koog.prompt.params.LLMParams.Schema.JSON.Simple",
"name": "Hero",
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "integer"
},
"superpower": {
"type": "string"
}
},
"required": [
"name",
"age",
"superpower"
]
}
}"""
)
}
})
I would have expected the schema to be this:
{
"type": "ai.koog.prompt.params.LLMParams.Schema.JSON.Simple",
"name": "Hero",
"description": "A simple data class for testing serialization", <----
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "integer"
},
"superpower": {
"type": "string",
"description": "The hero's superpower" <----
}
},
"required": [
"name",
"age",
"superpower"
]
}
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working