Skip to content

Issue with structured response parser #587

@nguyen-tri-nhan

Description

@nguyen-tri-nhan

I have a problem when serializing the response to model using com.openai.models.chat.completions.StructuredChatCompletionCreateParams

My model

data class Metadata(
    @JsonProperty("expected_result")
    @field:Schema(name = "expected_result")
    @JsonPropertyDescription("Expected result of a step.")
    val expectedResult: String?,

    @JsonPropertyDescription("What data users should provide.")
    val data: String?
)

When I call client.chat()..... with this model as Structured Response, the expectedResult always null

But when I change my model to

    val expected_result: String?,

I got the response correctly.

What happens with it, do we have problem with the serializer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedsdk

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions