S.
08/29/2025, 3:48 PMJsonStructuredData.createJsonStructure<List<NoteExercise>>()
this used to work with 0.3.0 but now crashes with Only object-like and no polymorphic types are supported for Default generator, got LIST
. Do I now have to specify the FULL
schema type for polymorphism, and if so, where do I do that?Konstantin
08/29/2025, 7:06 PMAndrey Bragin
08/30/2025, 9:27 AMBasicJsonSchemaGenerator
which does not support polymorphism. You can use StandardJsonSchemaGenerator
if you need more advanced schemas. And with new API, you might not even need to create schemas by hand, there's a higher level functions now, where you can just supply the class as a type parameter and it will choose the best structured output strategy (native/manual) and schema based on the model you are using. You can check these examples
https://github.com/JetBrains/koog/tree/develop/examples%2Fsrc%2Fmain%2Fkotlin%2Fai%2Fkoog%2Fagents%2Fexample%2FstructuredoutputS.
08/30/2025, 3:24 PMStandardJsonSchemaGenerator
does not work either.
I assume the new API you mean is nodeLLMRequestStructured
?
I'm just trying to use simpleOpenAIExecutor().executeStructed()
and it's StructuredOutputConfig
needs a schemaAndrey Bragin
08/30/2025, 3:30 PMexecutor.executeStructured
, here’s related issue comment. But the main problem is that you are passing List<NoteExercise>
. As the error message says, you can’t pass lists, you need to pass a class. E.g. wrapping your list in a classS.
08/31/2025, 10:53 AMS.
08/31/2025, 11:50 AMS.
08/31/2025, 11:52 AM