@box/box-ai-content-answers 0.54.3 → 0.54.5

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.
@@ -1,76 +1,76 @@
1
1
  import K from "lodash/camelCase";
2
2
  import t, { useCallback as X } from "react";
3
3
  import { useAgentsDispatch as Y } from "../../../contexts/AgentsContext.js";
4
- import { A as b, C as h, R as q } from "../../../../../chunks/types.js";
5
- import { SET_NEW_ITEM as z, UPDATE_QUESTION as B, SET_MODAL_ERROR as D, SET_MODAL_SUCCESS as Z, SET_IS_LOADING as w, CLEAR_CONVERSATION_HISTORY as U, SET_SUGGESTED_QUESTIONS_REQUEST_STATE as F, SET_SUGGESTED_QUESTIONS as ss } from "../actions.js";
4
+ import { A as L, C as z, R as q } from "../../../../../chunks/types.js";
5
+ import { SET_NEW_ITEM as B, UPDATE_QUESTION as D, SET_MODAL_ERROR as Z, SET_MODAL_SUCCESS as h, SET_IS_LOADING as w, CLEAR_CONVERSATION_HISTORY as U, SET_SUGGESTED_QUESTIONS_REQUEST_STATE as F, SET_SUGGESTED_QUESTIONS as ss } from "../actions.js";
6
6
  import { QuestionRecord as es } from "../records.js";
7
7
  import { defaultFormatSuggestions as os, defaultFormatCitations as ts } from "../utils/format.js";
8
8
  import { getAnswerRequest as as } from "../utils/request.js";
9
- import L from "../utils/stream.js";
9
+ import Q from "../utils/stream.js";
10
10
  const ns = /Too Many Requests/i;
11
11
  function ms({
12
12
  contentAnswers: n,
13
- createSessionRequest: Q,
13
+ createSessionRequest: k,
14
14
  dispatchStateUpdate: o,
15
- fetchTimeout: k,
16
- getAgentConfig: T,
15
+ fetchTimeout: T,
16
+ getAgentConfig: m,
17
17
  getAnswerStreaming: p,
18
18
  getAnswer: G,
19
- getSuggestedQuestions: m,
19
+ getSuggestedQuestions: y,
20
20
  isCitationsEnabled: rs,
21
21
  isStreamingEnabled: _,
22
- itemID: u,
22
+ itemID: l,
23
23
  formatCitations: g = ts
24
24
  }) {
25
25
  const P = t.useRef(null), A = Y(), I = X((s) => Array.isArray(s) ? g(s) : null, [g]);
26
26
  t.useEffect(
27
27
  (s) => {
28
- u && u !== n.item.id && o({
29
- type: z,
30
- itemID: u,
28
+ l && l !== n.item.id && o({
29
+ type: B,
30
+ itemID: l,
31
31
  fileVersionID: s
32
32
  });
33
33
  },
34
34
  // eslint-disable-next-line react-hooks/exhaustive-deps
35
- [u]
35
+ [l]
36
36
  );
37
37
  const C = t.useCallback((s, e) => {
38
38
  o({
39
- type: B,
39
+ type: D,
40
40
  newQuestion: s,
41
41
  session: e
42
42
  }), P.current = s;
43
43
  }, [o]), M = t.useCallback((s) => {
44
44
  o({
45
- type: D,
45
+ type: Z,
46
46
  error: s
47
47
  });
48
- }, [o]), y = t.useCallback((s, e, r) => {
48
+ }, [o]), S = t.useCallback((s, e, r) => {
49
49
  const {
50
- answer: E,
51
- error: i,
50
+ answer: i,
51
+ error: u,
52
52
  citations: a = [],
53
53
  createdAt: f = null,
54
- encodedSession: l = void 0,
55
- contextSession: c = void 0
56
- } = s, d = e.set("citations", I(a)).merge({
57
- answer: E,
58
- error: i,
54
+ encodedSession: c = void 0,
55
+ contextSession: E = void 0
56
+ } = s, b = e.set("citations", I(a)).merge({
57
+ answer: i,
58
+ error: u,
59
59
  created_at: f,
60
60
  isLoading: !1,
61
61
  isCompleted: r
62
62
  });
63
63
  let R;
64
- l && (R = {
65
- encodedSession: l
66
- }), c && (R = {
67
- contextSession: c
68
- }), C(d, R);
69
- }, [C, I]), S = t.useCallback(
64
+ c && (R = {
65
+ encodedSession: c
66
+ }), E && (R = {
67
+ contextSession: E
68
+ }), C(b, R);
69
+ }, [C, I]), O = t.useCallback(
70
70
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
71
71
  (s, e) => {
72
- var l, c;
73
- const r = (s == null ? void 0 : s.message) || "", E = ((l = s == null ? void 0 : s.response) == null ? void 0 : l.status) === 429 || ns.test(r), i = ((c = s == null ? void 0 : s.response) == null ? void 0 : c.status) === 204, a = i ? b.NO_CONTENT : E ? b.RATE_LIMITING : b.GENERAL, f = e.merge({
72
+ var c, E;
73
+ const r = (s == null ? void 0 : s.message) || "", i = ((c = s == null ? void 0 : s.response) == null ? void 0 : c.status) === 429 || ns.test(r), u = ((E = s == null ? void 0 : s.response) == null ? void 0 : E.status) === 204, a = u ? L.NO_CONTENT : i ? L.RATE_LIMITING : L.GENERAL, f = e.merge({
74
74
  error: a,
75
75
  isLoading: !1,
76
76
  isCompleted: !0
@@ -78,46 +78,46 @@ function ms({
78
78
  C(f, void 0);
79
79
  },
80
80
  [C]
81
- ), O = t.useCallback(async (s, e) => {
81
+ ), N = t.useCallback(async (s, e) => {
82
82
  try {
83
83
  const r = {
84
84
  prompt: s.prompt,
85
85
  aiAgent: e || void 0
86
- }, E = `content-answers-${s.id}`;
87
- let i;
88
- _ && (i = L.createAbortRequest(E));
89
- const a = await as(r, _, u, n, G, p, i);
90
- _ ? a.ok && a.status === 200 ? L.receiveStreamedResponse(E, a, (f) => {
86
+ }, i = `content-answers-${s.id}`;
87
+ let u;
88
+ _ && (u = Q.createAbortRequest(i));
89
+ const a = await as(r, _, i, l, n, G, p, u, T);
90
+ _ ? a.ok && a.status === 200 ? Q.receiveStreamedResponse(i, a, (f) => {
91
91
  const {
92
- data: l,
93
- error: c,
94
- citations: d,
92
+ data: c,
93
+ error: E,
94
+ citations: b,
95
95
  contextSession: R,
96
96
  isCompleted: J
97
97
  } = f;
98
- y({
98
+ S({
99
99
  ...{
100
- answer: l,
101
- citations: d,
102
- error: c,
100
+ answer: c,
101
+ citations: b,
102
+ error: E,
103
103
  contextSession: R
104
104
  }
105
105
  }, s, J);
106
- }, void 0, k) : S({
106
+ }, void 0, T) : O({
107
107
  response: a
108
- }, s) : (Object.entries(a).forEach(([f, l]) => {
109
- const c = K(f);
110
- delete a[f], a[c] = l;
111
- }), y(a, s, !0));
108
+ }, s) : (Object.entries(a).forEach(([f, c]) => {
109
+ const E = K(f);
110
+ delete a[f], a[E] = c;
111
+ }), S(a, s, !0));
112
112
  } catch (r) {
113
- S(r, s);
113
+ O(r, s);
114
114
  }
115
- }, [_, u, n, G, p, k, y, S]), N = t.useCallback((s, e, r = !0) => {
116
- const E = (n == null ? void 0 : n.questions) || [];
117
- r && (s.id = `${E.length}`);
118
- const i = new es(s);
119
- return C(i), O(i, e), i;
120
- }, [n == null ? void 0 : n.questions, O, C]), v = t.useCallback((s) => {
115
+ }, [_, l, n, G, p, T, S, O]), d = t.useCallback((s, e, r = !0) => {
116
+ const i = (n == null ? void 0 : n.questions) || [];
117
+ r && (s.id = `${i.length}`);
118
+ const u = new es(s);
119
+ return C(u), N(u, e), u;
120
+ }, [n == null ? void 0 : n.questions, N, C]), v = t.useCallback((s) => {
121
121
  const {
122
122
  encoded_session: e,
123
123
  metadata: {
@@ -127,7 +127,7 @@ function ms({
127
127
  }
128
128
  } = s;
129
129
  o({
130
- type: Z,
130
+ type: h,
131
131
  encodedSession: e,
132
132
  isLargeFile: r
133
133
  });
@@ -137,31 +137,31 @@ function ms({
137
137
  type: w,
138
138
  isLoading: !0
139
139
  });
140
- const s = await Q({
140
+ const s = await k({
141
141
  items: [n.item]
142
- }, u);
142
+ }, l);
143
143
  v(s);
144
144
  } catch {
145
- M(h.GENERAL);
145
+ M(z.GENERAL);
146
146
  }
147
- }, [o, Q, n.item, u, v, M]), x = t.useCallback(() => {
147
+ }, [o, k, n.item, l, v, M]), x = t.useCallback(() => {
148
148
  o({
149
149
  type: U
150
150
  });
151
151
  }, [o]), $ = t.useCallback(async (s, e) => {
152
- N({
152
+ d({
153
153
  ...s.toJS(),
154
154
  answer: "",
155
155
  isLoading: !0,
156
156
  isCompleted: !1,
157
157
  error: null
158
158
  }, e, !1);
159
- }, [N]), V = t.useCallback((s) => {
160
- L.abortRequest(`content-answers-${s.id}`, !0);
159
+ }, [d]), V = t.useCallback((s) => {
160
+ Q.abortRequest(`content-answers-${s.id}`, !0);
161
161
  }, []), W = t.useCallback(async (s) => {
162
- if (T)
162
+ if (m)
163
163
  try {
164
- const e = await T(s);
164
+ const e = await m(s);
165
165
  A({
166
166
  type: "OVERRIDE_AGENT_CONFIG",
167
167
  agentName: s.name,
@@ -169,14 +169,14 @@ function ms({
169
169
  });
170
170
  } catch {
171
171
  }
172
- }, [A, T]), H = t.useCallback(async () => {
173
- if (m) {
172
+ }, [A, m]), H = t.useCallback(async () => {
173
+ if (y) {
174
174
  o({
175
175
  type: F,
176
176
  requestState: q.IN_PROGRESS
177
177
  });
178
178
  try {
179
- const s = os(await m(u));
179
+ const s = os(await y(l));
180
180
  o({
181
181
  type: ss,
182
182
  suggestedQuestions: s
@@ -188,15 +188,15 @@ function ms({
188
188
  });
189
189
  }
190
190
  }
191
- }, [o, m, u]);
191
+ }, [o, y, l]);
192
192
  return {
193
193
  clearConversation: x,
194
194
  createSession: j,
195
195
  fetchAgentConfig: W,
196
196
  fetchSuggestedQuestions: H,
197
197
  retryQuestion: $,
198
- sendQuestion: N,
199
- sendQuestionAnswerRequest: O,
198
+ sendQuestion: d,
199
+ sendQuestionAnswerRequest: N,
200
200
  stopQuestion: V,
201
201
  updateQuestionInState: C
202
202
  };
@@ -1,7 +1,11 @@
1
- const r = async (e, l = !1, n, w, a, i, o) => {
2
- let s;
3
- return l && i ? s = await i(e, n, o, w) : a && (s = await a(e, n, w)), s;
1
+ import b, { FETCH_TIMEOUT as m } from "./stream.js";
2
+ const p = (i, s) => setTimeout(() => {
3
+ b.abortRequest(i);
4
+ }, s), E = async (i, s = !1, l, a, o, r, e, u, t) => {
5
+ let n;
6
+ const T = (t == null ? void 0 : t.initial) || m.initial, w = p(l, T);
7
+ return s && e ? n = await e(i, a, u, o) : r && (n = await r(i, a, o)), clearTimeout(w), n;
4
8
  };
5
9
  export {
6
- r as getAnswerRequest
10
+ E as getAnswerRequest
7
11
  };
@@ -1,58 +1,62 @@
1
1
  import b from "lodash/camelCase";
2
2
  import { A as s } from "../../../../../chunks/types.js";
3
- const u = 15e3, N = {
3
+ const C = {
4
+ chunk: 15 * 1e3,
5
+ // fetch timeout for each chunk. We need to abort the fetch if needed.
6
+ initial: 45 * 1e3
7
+ // latency p99 (30s) + buffer. Other host integrations can override this value.
8
+ }, u = {
4
9
  RESPONSE_FAILED: s.RESPONSE_FAILED,
5
10
  RESPONSE_INTERRUPTED: s.RESPONSE_INTERRUPTED,
6
11
  RESPONSE_STOPPED: s.RESPONSE_STOPPED
7
- }, C = {
12
+ }, d = {
8
13
  CONTINUE: "continue",
9
14
  DONE: "done",
10
15
  ERROR: "error"
11
16
  };
12
17
  class T {
13
18
  constructor() {
14
- this.abortControllerMap = /* @__PURE__ */ new Map(), this.fetchTimeout = u;
19
+ this.abortControllerMap = /* @__PURE__ */ new Map(), this.chunkTimeout = C.chunk;
15
20
  }
16
- abortRequest(t, e = !1) {
17
- const o = this.abortControllerMap.get(t);
18
- o && (o.isAbortFunctionCalled = !0, o.isUserInitiatedAbort = e, this.abortControllerMap.set(t, o), o.abortController.abort());
21
+ abortRequest(o, i = !1) {
22
+ const r = this.abortControllerMap.get(o);
23
+ r && (r.isAbortFunctionCalled = !0, r.isUserInitiatedAbort = i, this.abortControllerMap.set(o, r), r.abortController.abort());
19
24
  }
20
- createAbortRequest(t) {
21
- const e = {
25
+ createAbortRequest(o) {
26
+ const i = {
22
27
  abortController: new AbortController(),
23
28
  isAbortFunctionCalled: !1,
24
29
  isUserInitiatedAbort: !1
25
30
  };
26
- return this.abortControllerMap.set(t, e), e.abortController;
31
+ return this.abortControllerMap.set(o, i), i.abortController;
27
32
  }
28
33
  // eslint-disable-next-line class-methods-use-this
29
- parseNDJSON(t, e, o) {
30
- const i = new TextDecoder().decode(e), r = t.partialData + i, l = /\r?\n/, n = r.trim().split(l);
31
- t.partialData = r.endsWith(`
32
- `) || r.endsWith("}") ? "" : n.pop() || "";
34
+ parseNDJSON(o, i, r) {
35
+ const n = new TextDecoder().decode(i), t = o.partialData + n, l = /\r?\n/, e = t.trim().split(l);
36
+ o.partialData = t.endsWith(`
37
+ `) || t.endsWith("}") ? "" : e.pop() || "";
33
38
  let a = "";
34
- n.forEach((h) => {
39
+ e.forEach((h) => {
35
40
  const E = JSON.parse(h);
36
- E[o] && (a += E[o]), Object.entries(E).forEach(([c, O]) => {
37
- const d = b(c);
38
- d !== o && (t[d] = O);
41
+ E[r] && (a += E[r]), Object.entries(E).forEach(([c, O]) => {
42
+ const N = b(c);
43
+ N !== r && (o[N] = O);
39
44
  });
40
- }), t.data += a;
45
+ }), o.data += a;
41
46
  }
42
- receiveStreamedResponse(t, e, o, i = "answer", r) {
47
+ receiveStreamedResponse(o, i, r, n = "answer", t) {
43
48
  var E;
44
- const l = this.initializeStreamedResponseState(), n = (E = e.body) == null ? void 0 : E.getReader();
45
- if (this.fetchTimeout = r || u, !n) {
46
- this.handleNoResponseBody(o, l);
49
+ const l = this.initializeStreamedResponseState(), e = (E = i.body) == null ? void 0 : E.getReader();
50
+ if (this.chunkTimeout = (t == null ? void 0 : t.chunk) || C.chunk, !e) {
51
+ this.handleNoResponseBody(r, l);
47
52
  return;
48
53
  }
49
- const a = {
50
- id: void 0
51
- }, h = () => {
52
- n.read().then((c) => {
53
- this.handleChunkSuccess(a, o, c, t, l, i), c.done || (a.id = this.setChunkTimeout(t), h());
54
+ let a;
55
+ const h = () => {
56
+ e.read().then((c) => {
57
+ this.handleChunkSuccess(a, r, c, o, l, n), c.done || (a = this.setChunkTimeout(o), h());
54
58
  }).catch((c) => {
55
- this.handleChunkError(a, o, t, l);
59
+ this.handleChunkError(a, r, o, l);
56
60
  });
57
61
  };
58
62
  h();
@@ -69,37 +73,37 @@ class T {
69
73
  partialData: ""
70
74
  };
71
75
  }
72
- handleChunkSuccess(t, e, o, i, r, l) {
73
- if (!o)
76
+ handleChunkSuccess(o, i, r, n, t, l) {
77
+ if (!r)
74
78
  return;
75
- clearTimeout(t.id);
79
+ clearTimeout(o);
76
80
  const {
77
- completionReason: n
78
- } = r;
79
- r.isCompleted = o.done || n !== null, o.value && this.parseNDJSON(r, o.value, l), r.isCompleted && (this.removeAbortController(i), n !== C.DONE && (r.data ? r.error = n === C.CONTINUE ? N.RESPONSE_INTERRUPTED : N.RESPONSE_FAILED : r.error = s.NO_CONTENT)), e(r);
81
+ completionReason: e
82
+ } = t;
83
+ t.isCompleted = r.done || e !== null, r.value && this.parseNDJSON(t, r.value, l), t.isCompleted && (this.removeAbortController(n), e !== d.DONE && (t.data ? t.error = e === d.CONTINUE ? u.RESPONSE_INTERRUPTED : u.RESPONSE_FAILED : t.error = s.NO_CONTENT)), i(t);
80
84
  }
81
- handleChunkError(t, e, o, i) {
82
- i.error = N.RESPONSE_FAILED;
83
- const r = this.abortControllerMap.get(o);
84
- r && r.isUserInitiatedAbort && (i.error = N.RESPONSE_STOPPED, i.isAborted = r.isUserInitiatedAbort), i.isCompleted = !0, this.removeAbortController(o), clearTimeout(t.id), e(i);
85
+ handleChunkError(o, i, r, n) {
86
+ n.error = u.RESPONSE_FAILED;
87
+ const t = this.abortControllerMap.get(r);
88
+ t && t.isUserInitiatedAbort && (n.error = u.RESPONSE_STOPPED, n.isAborted = t.isUserInitiatedAbort), n.isCompleted = !0, this.removeAbortController(r), clearTimeout(o), i(n);
85
89
  }
86
90
  // eslint-disable-next-line class-methods-use-this
87
- handleNoResponseBody(t, e) {
88
- e.error = s.NO_CONTENT, e.isCompleted = !0, t(e);
91
+ handleNoResponseBody(o, i) {
92
+ i.error = s.NO_CONTENT, i.isCompleted = !0, o(i);
89
93
  }
90
- removeAbortController(t) {
91
- this.abortControllerMap.delete(t);
94
+ removeAbortController(o) {
95
+ this.abortControllerMap.delete(o);
92
96
  }
93
- setChunkTimeout(t) {
97
+ setChunkTimeout(o) {
94
98
  return setTimeout(() => {
95
- this.abortRequest(t);
96
- }, this.fetchTimeout);
99
+ this.abortRequest(o);
100
+ }, this.chunkTimeout);
97
101
  }
98
102
  }
99
- const A = new T();
103
+ const P = new T();
100
104
  export {
101
- u as FETCH_CHUNK_TIMEOUT,
102
- C as STREAMING_COMPLETION_REASON,
103
- N as STREAM_ERROR,
104
- A as default
105
+ C as FETCH_TIMEOUT,
106
+ d as STREAMING_COMPLETION_REASON,
107
+ u as STREAM_ERROR,
108
+ P as default
105
109
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/box-ai-content-answers",
3
- "version": "0.54.3",
3
+ "version": "0.54.5",
4
4
  "peerDependencies": {
5
5
  "@box/blueprint-web": "^7.8.0",
6
6
  "@box/blueprint-web-assets": "^4.16.0",
@@ -13,7 +13,7 @@
13
13
  "remarkable": "^2.0.1"
14
14
  },
15
15
  "devDependencies": {
16
- "@box/blueprint-web": "^7.31.0",
16
+ "@box/blueprint-web": "^7.31.1",
17
17
  "@box/blueprint-web-assets": "^4.26.0",
18
18
  "@box/storybook-utils": "^0.6.1",
19
19
  "@testing-library/react": "^15.0.6",
@@ -52,5 +52,5 @@
52
52
  "**/*.css"
53
53
  ],
54
54
  "license": "SEE LICENSE IN LICENSE",
55
- "gitHead": "d1532d582650321a4dd8c34869a7d84c13e778ac"
55
+ "gitHead": "d76dca7d74745cd366345066918901888e7d76d2"
56
56
  }
@@ -36,9 +36,6 @@ export type StreamResponseProps = {
36
36
  isCompleted: boolean;
37
37
  partialData: string;
38
38
  };
39
- export type ChunkTimeout = {
40
- id?: ReturnType<typeof setTimeout>;
41
- };
42
39
  export type PremissionsResponse = {
43
40
  is_valid_user: boolean;
44
41
  };
@@ -54,7 +51,7 @@ export type fetchError = {
54
51
  };
55
52
  export type ApiWrapperProps = {
56
53
  createSessionRequest?: (payload: Record<string, unknown>, itemID: string) => Promise<CreateSessionResponse>;
57
- fetchTimeout?: number;
54
+ fetchTimeout?: StreamResponseTimeout;
58
55
  formatCitations?: (citations: Array<CitationResponse>) => Array<CitationType>;
59
56
  getAgentConfig?: agentFetcherType;
60
57
  getAnswer?: fetcherType;
@@ -95,3 +92,7 @@ export type ApiWrapperWithInjectedProps = ApiWrapperProps & {
95
92
  shouldRenderProviders: boolean;
96
93
  stopQuestion: StopQuestion;
97
94
  };
95
+ export type StreamResponseTimeout = {
96
+ chunk: number;
97
+ initial: number;
98
+ };
@@ -1,4 +1,4 @@
1
1
  import { type ContentAnswersRecordType } from '../records';
2
- import { type fetcherStreamingType, type fetcherType } from '../types';
3
- declare const getAnswerRequest: (payload: Record<string, unknown>, isStreamingRequest?: boolean, itemID?: string, state?: ContentAnswersRecordType, fetcher?: fetcherType, fetcherStreaming?: fetcherStreamingType, abortController?: AbortController) => Promise<any>;
2
+ import { type fetcherStreamingType, type fetcherType, type StreamResponseTimeout } from '../types';
3
+ declare const getAnswerRequest: (payload: Record<string, unknown>, isStreamingRequest: boolean, requestID: string, itemID?: string, state?: ContentAnswersRecordType, fetcher?: fetcherType, fetcherStreaming?: fetcherStreamingType, abortController?: AbortController, fetchTimeout?: StreamResponseTimeout) => Promise<any>;
4
4
  export { getAnswerRequest };
@@ -1,6 +1,6 @@
1
1
  import { ANSWER_ERROR } from '../../../types';
2
- import { type ChunkTimeout, type ExtendedReadableStreamReadResult, type ReadableStreamResponse, type StreamAbort, type StreamResponseProps } from '../types';
3
- export declare const FETCH_CHUNK_TIMEOUT = 15000;
2
+ import { type ExtendedReadableStreamReadResult, type ReadableStreamResponse, type StreamAbort, type StreamResponseProps, type StreamResponseTimeout } from '../types';
3
+ export declare const FETCH_TIMEOUT: StreamResponseTimeout;
4
4
  export declare const STREAM_ERROR: {
5
5
  RESPONSE_FAILED: ANSWER_ERROR;
6
6
  RESPONSE_INTERRUPTED: ANSWER_ERROR;
@@ -13,14 +13,14 @@ export declare const STREAMING_COMPLETION_REASON: {
13
13
  };
14
14
  declare class StreamUtils {
15
15
  abortControllerMap: Map<string, StreamAbort>;
16
- fetchTimeout: number;
16
+ chunkTimeout: number;
17
17
  abortRequest(requestID: string, userAborted?: boolean): void;
18
18
  createAbortRequest(requestID: string): AbortController;
19
19
  parseNDJSON(responseState: StreamResponseProps, rawChunk: Uint8Array, streamingProperty: any): void;
20
- receiveStreamedResponse(requestID: string, response: ReadableStreamResponse, onStreamResponse: (responseState: StreamResponseProps) => void, streamingProperty?: string, fetchTimeout?: number): void;
20
+ receiveStreamedResponse(requestID: string, response: ReadableStreamResponse, onStreamResponse: (responseState: StreamResponseProps) => void, streamingProperty?: string, fetchTimeout?: StreamResponseTimeout): void;
21
21
  initializeStreamedResponseState(): StreamResponseProps;
22
- handleChunkSuccess(chunkTimeout: ChunkTimeout, onStreamResponse: (responseState: StreamResponseProps) => void, result: ExtendedReadableStreamReadResult, requestID: string, streamedResponseState: StreamResponseProps, streamingProperty: any): void;
23
- handleChunkError(chunkTimeout: ChunkTimeout, onStreamResponse: (responseState: StreamResponseProps) => void, requestID: string, streamedResponseState: StreamResponseProps): void;
22
+ handleChunkSuccess(chunkTimeoutId: number, onStreamResponse: (responseState: StreamResponseProps) => void, result: ExtendedReadableStreamReadResult, requestID: string, streamedResponseState: StreamResponseProps, streamingProperty: any): void;
23
+ handleChunkError(chunkTimeoutId: any, onStreamResponse: (responseState: StreamResponseProps) => void, requestID: string, streamedResponseState: StreamResponseProps): void;
24
24
  handleNoResponseBody(onStreamResponse: (responseState: StreamResponseProps) => void, streamedResponseState: StreamResponseProps): void;
25
25
  removeAbortController(requestID: string): void;
26
26
  setChunkTimeout(requestID: string): ReturnType<typeof setTimeout>;