Skip to content

Retrieving contents of CSV file errors on JSON parsing #562

@nuclearghost

Description

@nuclearghost

Describe the bug
The OpenAI Assistant has generated a CSV file. When I attempt to retrieve its contents with openai_client.files.content(id: 'file_id') it generates the error unexpected character (after [0]) at line 1, column 2 [parse.c:744] which appears to be the JSON parser trying to parse CSV content.

To Reproduce

openai_client.files.retrieve id: "file-NexuEUjWpoehzmkQ5zer7W"
{"object"=>"file",
 "id"=>"file-NexuEUjWpoehzmkQ5zer7W",
 "purpose"=>"assistants_output",
 "filename"=>"/mnt/data/normalized_file.csv",
 "bytes"=>1630,
 "created_at"=>1738176534,
 "status"=>"processed",
 "status_details"=>nil}
openai_client.files.content id: "file-NexuEUjWpoehzmkQ5zer7W"
: unexpected character (after [0]) at line 1, column 2 [parse.c:744]

Expected behavior
The CSV file contents are able to be read without error.

Desktop (please complete the following information):

  • OS: macOS 15.2
  • Ruby version: 3.2.2
  • Gem version: 7.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions