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

docs: add bun to list of runtimes #247

Closed
wants to merge 2 commits into from

Conversation

colinhacks
Copy link

@colinhacks colinhacks commented Aug 24, 2023

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

  • Add Bun to list of runtimes
  • Add instructions for Bun package manager
  • Update existing Bun ecosystem test where npm is used instead of bun

Additional context & links

The openai package is now fully supported in Bun: https://bun.sh/blog/bun-v0.8.0#use-openai-in-bun

@colinhacks colinhacks changed the title colinhacks/add bun docs: add bun instructions Aug 24, 2023
@colinhacks colinhacks changed the title docs: add bun instructions docs: add bun to list of runtimes Aug 24, 2023
@rattrayalex
Copy link
Collaborator

Hey Colin! Thanks so much for adding support for File! We'll want to run some additional tests on our end to ensure that file uploads and other things work well in Bun before merging this, but otherwise LGTM – thanks for the contribution!

@rattrayalex
Copy link
Collaborator

rattrayalex commented Aug 29, 2023

Hi @colinhacks , our testing is showing that file uploads aren't working with Bun (tested on 0.8.1) – we were getting errors like filename not being found and request body being malformed.

Some repros:

const url = 'https://audio-samples.github.io/samples/mp3/blizzard_biased/sample-1.mp3';
const filename = 'sample-1.mp3';

const correctAnswer =
  'It was anxious to find him no one that expectation of a man who were giving his father enjoyment. But he was avoided in sight in the minister to which indeed,';
const model = 'whisper-1';

test('handles Response', async function () {
  const file = await fetch(url);

  const result = await client.audio.transcriptions.create({ file, model });
  expect(result.text).toBe(correctAnswer);
});

test('handles builtin File', async function () {
  const file = await fetch(url)
    .then((x) => x.arrayBuffer())
    // @ts-ignore avoid DOM lib for testing purposes
    .then((x) => new File([x], filename));

  const result = await client.audio.transcriptions.create({ file, model });
  expect(result.text).toBe(correctAnswer);
})

both give errors like so:

error: The browser (or proxy) sent a request that this server could not understand.
 code: "null"

@rattrayalex
Copy link
Collaborator

This has been done in a separate PR. Thanks @colinhacks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants