How to use stream: true?
See original GitHub issueI’m a bit lost as to how to actually use stream: true
in this library.
Example incorrect syntax:
const res = await openai.createCompletion({
model: "text-davinci-002",
prompt: "Say this is a test",
max_tokens: 6,
temperature: 0,
stream: true,
});
res.onmessage = (event) => {
console.log(event.data);
}
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:11
Top Results From Across the Web
How does requests' stream=True option streams data one ...
I've checked several SOF questions and looked at the requests library documentation, but all resources explain how to use the library to ...
Read more >Python Requests: response.content vs stream=True - Reddit
Using stream will start writing to the file before the entire file is downloaded. Whether that's a good or bad thing depends entirely...
Read more >requests.get(stream=True) will get incomplete data #4227
the content I get is incomplete.But when I use stream=False,I can get complete data. when I set stream=True and response.iter_content(chunk_size ...
Read more >Advanced Usage — Requests 2.28.1 documentation
with requests.get('https://httpbin.org/get', stream=True) ...
Read more >Streaming requests with the fetch API - Chrome Developers
This shows how you can stream data from the user to the server, and send data back that can be processed in real...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
here
You can use axios stream response type. But you still need to parse the returned data.