Skip to content

typescript sdk breaking when outputFormat: OutputFormat.TextCsv #20

@andrei-ce

Description

@andrei-ce

Hi! Great project, pretty awesome capabilities! 👏

So, I have not found any similar issues and maybe I have configured something wrong, but... Using the typescript sdk, I set my call to be like so, given that content is a pdf file.

const partitionRes = await client.general.partition({
      partitionParameters: {
        files: { content, fileName },
        strategy: Strategy.HiRes,
        outputFormat: OutputFormat.TextCsv,
      },
})
console.log('hi')

and the code never gets past these lines ("hi" is never printed). When I set outputFormat to be "OutputFormat.ApplicationJson" everything works great. It seems to me that the client is doing something that expects a JSON format as this is the error I get on the console:

UnexpectedClientError: Unexpected HTTP client error: SyntaxError: Unexpected token 'y', "type,elemen"... is not valid JSON

Is there any additional config I have to do? In here I have succeeded in getting a csv response, but not on the typescript sdk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions