Skip to content

Metadata should have a nicely typed put method #338

Open
@ydolzhenko

Description

@ydolzhenko

metadata setter of ResponseCreateParams.builder()accepts Metadata object, which, in turn may contain ```
numeric fields:

 val metadata = Metadata.builder() .putAdditionalProperty("someNumericId", JsonNumber.of(123)) .build(); 

Response with such metadata instance fails though:

ResponseCreateParams.builder().metadata(metadata).build().... 

showing error:

com.openai.errors.BadRequestException: 400: OpenAIError{additionalProperties={error={message=Invalid type for 'metadata.someNumericId': expected a string, but got an integer instead., type=invalid_request_error, param=metadata.someNumericId, code=invalid_type}}}

String as a value works fine though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions