Commit 0f995702 authored by Travis Fischer's avatar Travis Fischer

docs: add a note in the readme about onProgress and onConversationResponse

parent 25510460
...@@ -97,6 +97,8 @@ const response = await api.sendMessage('this is a timeout test', { ...@@ -97,6 +97,8 @@ const response = await api.sendMessage('this is a timeout test', {
}) })
``` ```
You can stream responses using the `onProgress` or `onConversationResponse` callbacks. See the [docs](./docs/classes/ChatGPTAPI.md) for more details.
<details> <details>
<summary>Usage in CommonJS (Dynamic import)</summary> <summary>Usage in CommonJS (Dynamic import)</summary>
......
...@@ -142,7 +142,7 @@ export class ChatGPTAPI { ...@@ -142,7 +142,7 @@ export class ChatGPTAPI {
headers: { headers: {
Authorization: `Bearer ${accessToken}`, Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'user-agent': this._userAgent 'User-Agent': this._userAgent
}, },
body: JSON.stringify(body), body: JSON.stringify(body),
signal: abortSignal, signal: abortSignal,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment