Skip to content

When unmarshaling ChatCompletionChunk, the sdk doesn't check if the input is valid #379

Open
@spacewander

Description

@spacewander

Using the snippet below:

	chunk = openai.ChatCompletionChunk{}
	err := json.Unmarshal([]byte(`[]`), &chunk)
	fmt.Printf("%+v\n", err)

The err is nil and the chunk is successfully unmarshalled, though it will have empty value except that the raw field is [].

Metadata

Metadata

Assignees

No one assigned

    Labels

    sdkA bug related to the implementation core SDK features, such as Marshalling, Unmarshalling.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions