Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileResponse.Size should be nullable #203

Closed
chadcts opened this issue Dec 7, 2023 · 4 comments · Fixed by #204 or RageAgainstThePixel/com.openai.unity#140
Closed

FileResponse.Size should be nullable #203

chadcts opened this issue Dec 7, 2023 · 4 comments · Fixed by #204 or RageAgainstThePixel/com.openai.unity#140
Labels
bug Something isn't working

Comments

@chadcts
Copy link

chadcts commented Dec 7, 2023

Bug Report

Overview

When dealing with GPT generated images (ContentType.ImageFile), the Json return Null for "bytes" which causes a Json deserialization exception.

{
  "object": "file",
  "id": "file-iPkbfqILMiBDCeGe5g7aevPg",
  "purpose": "assistants_output",
  "filename": "de65da7b-686d-4826-a7eb-6461dfb956e8",
  "bytes": null, // <- missing?
  "created_at": 1701920681,
  "status": "processed",
  "status_details": null
}

To Reproduce

Steps to reproduce the behavior:

  1. Ask OpenAI to draw you an image using the Assistants endpoint.
  2. Try to get the file info of the image content from FilesEndpoint.GetFileInfoAsync()

Additional context

[JsonInclude]
[JsonPropertyName("bytes")]
public int Size { get; private set; }

Simple fix:

        [JsonInclude]
        [JsonPropertyName("bytes")]
        public int? Size { get; private set; }
@chadcts chadcts added the bug Something isn't working label Dec 7, 2023
@StephenHodgson
Copy link
Member

So it didn't have a size?
Seems kinda strange why the bytes would be nul

@StephenHodgson
Copy link
Member

Did it not actually generate an image?

@StephenHodgson StephenHodgson changed the title FileResponse causes exception when created from a GPT generated image. FileResponse.Size should be nullable Dec 7, 2023
@chadcts
Copy link
Author

chadcts commented Dec 7, 2023 via email

@StephenHodgson
Copy link
Member

Also curious about what the expected encoding would even be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
2 participants