@sksharma72000/ai-chat-websdk 1.2.2 → 1.2.3

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.
@@ -6,6 +6,8 @@ interface UseChatModeProps {
6
6
  sessionId: string;
7
7
  /** Permanent browser identifier, sent as `browser-session` header on every request. */
8
8
  browserSession: string;
9
+ /** Abort an in-flight AI request after this many ms. Defaults to 300000. */
10
+ requestTimeoutMs?: number;
9
11
  setIsPerformingClientAction: (v: boolean) => void;
10
12
  /** Async callback invoked on 401 — must return a fresh JWT string */
11
13
  onTokenExpired?: () => Promise<string>;
@@ -20,5 +22,5 @@ interface UseChatModeReturn {
20
22
  optionIndex?: number;
21
23
  }) => Promise<AIResponseData>;
22
24
  }
23
- export declare function useChatMode({ apiUrl, jwtToken, sessionId, browserSession, setIsPerformingClientAction: _setIsPerformingClientAction, onTokenExpired, onBeforeMessageSend, onTokenRefreshed, }: UseChatModeProps): UseChatModeReturn;
25
+ export declare function useChatMode({ apiUrl, jwtToken, sessionId, browserSession, requestTimeoutMs, setIsPerformingClientAction: _setIsPerformingClientAction, onTokenExpired, onBeforeMessageSend, onTokenRefreshed, }: UseChatModeProps): UseChatModeReturn;
24
26
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sksharma72000/ai-chat-websdk",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "@sksharma72000/ai-chat-websdk is an embeddable, fully themeable AI chat widget for web apps. Supports JWT authentication with auto-refresh, rich content rendering (tables, code blocks, markdown), theming via CSS custom properties, and framework-agnostic mounting.",
5
5
  "main": "./ai-chat-websdk.umd.js",
6
6
  "module": "./ai-chat-websdk.es.js",
package/types/config.d.ts CHANGED
@@ -95,4 +95,10 @@ export interface SDKConfig {
95
95
  * the conversation.
96
96
  */
97
97
  closeAction?: 'minimize-fab' | 'minimize-header';
98
+ /**
99
+ * How long (ms) to wait for an AI response before aborting the request.
100
+ * Compiling a question paper can take a couple of minutes, so this defaults
101
+ * to 300000 (5 min). Set higher if your backend / proxy allows it.
102
+ */
103
+ requestTimeoutMs?: number;
98
104
  }