Skip to content

Using .csv or .json with Agents SDK #411

@bakikucukcakiroglu

Description

@bakikucukcakiroglu

I want to use .csv or .json files with openai-agents-js. It works for pdf with the following code but gives 400 The file type you uploaded is not supported. Please try again with a pdf error for other types.

const result = await runner.run(
  categoryExtractorAgent,
  [
    {
      role: 'user',
      content: [
        {
          type: 'input_file',
          file: fileDataUrl,
          providerData: {
            filename: req.file.originalname,
          }
        }
      ],
    }
  ],
);

Giving a file url instead of base64 file is not also working.

It is weird that we can only use pdfs and I couldn't understand the file logic of Completions and Responses APIs at all. Isn't it possible to upload files other than pdfs? If so, how do we upload in ChatGPT?

If uploading json, csv etc. possible, how? What is the logic?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions