ai 2.1.6 → 2.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -138,7 +138,7 @@ declare type UseChatOptions = {
138
138
  /**
139
139
  * Callback function to be called when the API response is received.
140
140
  */
141
- onResponse?: (response: Response) => void;
141
+ onResponse?: (response: Response) => void | Promise<void>;
142
142
  /**
143
143
  * Callback function to be called when the chat is finished streaming.
144
144
  */
@@ -194,7 +194,7 @@ declare type UseCompletionOptions = {
194
194
  /**
195
195
  * Callback function to be called when the API response is received.
196
196
  */
197
- onResponse?: (response: Response) => void;
197
+ onResponse?: (response: Response) => void | Promise<void>;
198
198
  /**
199
199
  * Callback function to be called when the completion is finished streaming.
200
200
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -36,7 +36,7 @@ declare type UseChatOptions = {
36
36
  /**
37
37
  * Callback function to be called when the API response is received.
38
38
  */
39
- onResponse?: (response: Response) => void;
39
+ onResponse?: (response: Response) => void | Promise<void>;
40
40
  /**
41
41
  * Callback function to be called when the chat is finished streaming.
42
42
  */
@@ -92,7 +92,7 @@ declare type UseCompletionOptions = {
92
92
  /**
93
93
  * Callback function to be called when the API response is received.
94
94
  */
95
- onResponse?: (response: Response) => void;
95
+ onResponse?: (response: Response) => void | Promise<void>;
96
96
  /**
97
97
  * Callback function to be called when the completion is finished streaming.
98
98
  */
@@ -38,7 +38,7 @@ declare type UseChatOptions = {
38
38
  /**
39
39
  * Callback function to be called when the API response is received.
40
40
  */
41
- onResponse?: (response: Response) => void;
41
+ onResponse?: (response: Response) => void | Promise<void>;
42
42
  /**
43
43
  * Callback function to be called when the chat is finished streaming.
44
44
  */
@@ -94,7 +94,7 @@ declare type UseCompletionOptions = {
94
94
  /**
95
95
  * Callback function to be called when the API response is received.
96
96
  */
97
- onResponse?: (response: Response) => void;
97
+ onResponse?: (response: Response) => void | Promise<void>;
98
98
  /**
99
99
  * Callback function to be called when the completion is finished streaming.
100
100
  */
@@ -38,7 +38,7 @@ declare type UseChatOptions = {
38
38
  /**
39
39
  * Callback function to be called when the API response is received.
40
40
  */
41
- onResponse?: (response: Response) => void;
41
+ onResponse?: (response: Response) => void | Promise<void>;
42
42
  /**
43
43
  * Callback function to be called when the chat is finished streaming.
44
44
  */
@@ -94,7 +94,7 @@ declare type UseCompletionOptions = {
94
94
  /**
95
95
  * Callback function to be called when the API response is received.
96
96
  */
97
- onResponse?: (response: Response) => void;
97
+ onResponse?: (response: Response) => void | Promise<void>;
98
98
  /**
99
99
  * Callback function to be called when the completion is finished streaming.
100
100
  */