simonw / simonw/til

Issues with OpenAI Streaming code

Open
#86 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1.5k
Forks
120
PR merge metrics
No merged PRs in 30d

Description

When I run your async code, I get:
Error: await can't be used outside of a function.
When I enclose the async code within an async function, I get:
 TypeError: object Stream can't be used in 'await' expression

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the async OpenAI streaming example referenced by the issue and reproduce both reported errors: using await at top level and awaiting the Stream object. Determine the intended invocation from the surrounding example; done means the documented async code runs without either error.

Written by the indexing model from the issue text.

Assessment

Domain
ai
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.