Skip to content

JSON Parse Errors in searchAndContents #92

@rohrz4nge

Description

@rohrz4nge

Hey there! When using the exa js sdk like this:

await exa.searchAndContents(prompt, {
  type: "auto",
  useAutoprompt: true,
  numResults: 10,
  text: true,
  highlights: true,
  livecrawl: "always",
});

we're seeing these errors:

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at parseJSONFromBytes (node:internal/deps/undici/undici:5738:19)
    at successSteps (node:internal/deps/undici/undici:5719:27)
    at fullyReadBody (node:internal/deps/undici/undici:4609:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async consumeBody (node:internal/deps/undici/undici:5728:7)
    at async Exa2.request (/usr/src/app/node_modules/.pnpm/exa-js@1.9.3_ws@8.18.1/node_modules/exa-js/dist/index.js:1443:25)
    at async Exa2.searchAndContents (/usr/src/app/node_modules/.pnpm/exa-js@1.9.3_ws@8.18.1/node_modules/exa-js/dist/index.js:1511:12)

We're running on node v23.6.0 and exa-js 1.9.3

Our guess is that this is a rate limit issue. I doubt it's a direct issue with this sdk but if you could add a function that just returns the plain text instead of the JSON parsed object it would help us tremendously (even better if it would differentiate between errors returned from the api) :)

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