@icos-react/largemodel 1.0.28 → 1.0.29

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
@@ -968,6 +968,16 @@ interface MessageActionCallbacks {
968
968
  onCopy?: (content: string, messageId: string | number) => Promise<void> | void;
969
969
  onRefresh?: (messageId: string | number, userMessageContent: string) => Promise<void> | void;
970
970
  }
971
+ interface ChatDemoRef$1 {
972
+ sendMessage: (message: string, isCreateApp?: boolean, variable?: any) => Promise<void>;
973
+ sendMessageWithControl: (message: string, showUserMessage?: boolean, variable?: any, resetSession?: boolean) => Promise<void>;
974
+ setInputText: (text: string) => void;
975
+ /** 中止当前正在进行的 AI 流式请求 */
976
+ stopGeneration: () => void;
977
+ getMidVal: () => any;
978
+ getVariables: () => any;
979
+ updateVariables: (newVariables: any) => void;
980
+ }
971
981
  interface ChatXProps$1 {
972
982
  buttonImage?: string;
973
983
  userIcon?: string;
@@ -1104,11 +1114,6 @@ interface ChatXProps$1 {
1104
1114
  formatThinkingBarTitle?: (thinkingTimeMs: number) => string;
1105
1115
  }
1106
1116
 
1107
- interface ChatDemoRef$1 {
1108
- sendMessage: (message: string, isCreateApp?: boolean, variable?: any) => Promise<void>;
1109
- sendMessageWithControl: (message: string, showUserMessage?: boolean, variable?: any, resetSession?: boolean) => Promise<void>;
1110
- setInputText: (text: string) => void;
1111
- }
1112
1117
  declare const ChatDemo: React__default.ForwardRefExoticComponent<ChatXProps$1 & React__default.RefAttributes<ChatDemoRef$1>>;
1113
1118
 
1114
1119
  /**
package/dist/index.js CHANGED
@@ -6029,6 +6029,9 @@ var ChatDemo = (0, import_react21.forwardRef)(
6029
6029
  },
6030
6030
  updateVariables: (newVariables) => {
6031
6031
  setInternalVariables(newVariables);
6032
+ },
6033
+ stopGeneration: () => {
6034
+ handleStopResponse();
6032
6035
  }
6033
6036
  }),
6034
6037
  [sendMessage, sendMessageWithControl, midVal, internalVariables]
@@ -7303,6 +7306,14 @@ var ChatAssistant = (0, import_react23.forwardRef)(
7303
7306
  setContentEditableText(customInputElementRef.current, text, true);
7304
7307
  }, 0);
7305
7308
  }
7309
+ },
7310
+ stopGeneration: () => {
7311
+ chatDemoRef.current?.stopGeneration?.();
7312
+ },
7313
+ getMidVal: () => chatDemoRef.current?.getMidVal?.(),
7314
+ getVariables: () => chatDemoRef.current?.getVariables?.(),
7315
+ updateVariables: (newVariables) => {
7316
+ chatDemoRef.current?.updateVariables?.(newVariables);
7306
7317
  }
7307
7318
  }),
7308
7319
  [sendStatus, history]
@@ -8876,6 +8887,17 @@ var ChatButton = (0, import_react25.forwardRef)(
8876
8887
  internalRef.current.setInputText(text);
8877
8888
  }
8878
8889
  }, 100);
8890
+ },
8891
+ stopGeneration: () => {
8892
+ internalRef.current?.stopGeneration?.();
8893
+ },
8894
+ close: () => {
8895
+ setIsOpen(false);
8896
+ },
8897
+ getMidVal: () => internalRef.current?.getMidVal?.(),
8898
+ getVariables: () => internalRef.current?.getVariables?.(),
8899
+ updateVariables: (newVariables) => {
8900
+ internalRef.current?.updateVariables?.(newVariables);
8879
8901
  }
8880
8902
  }), [isOpen]);
8881
8903
  (0, import_react25.useEffect)(() => {
package/dist/index.mjs CHANGED
@@ -5980,6 +5980,9 @@ var ChatDemo = forwardRef5(
5980
5980
  },
5981
5981
  updateVariables: (newVariables) => {
5982
5982
  setInternalVariables(newVariables);
5983
+ },
5984
+ stopGeneration: () => {
5985
+ handleStopResponse();
5983
5986
  }
5984
5987
  }),
5985
5988
  [sendMessage, sendMessageWithControl, midVal, internalVariables]
@@ -7262,6 +7265,14 @@ var ChatAssistant = forwardRef6(
7262
7265
  setContentEditableText(customInputElementRef.current, text, true);
7263
7266
  }, 0);
7264
7267
  }
7268
+ },
7269
+ stopGeneration: () => {
7270
+ chatDemoRef.current?.stopGeneration?.();
7271
+ },
7272
+ getMidVal: () => chatDemoRef.current?.getMidVal?.(),
7273
+ getVariables: () => chatDemoRef.current?.getVariables?.(),
7274
+ updateVariables: (newVariables) => {
7275
+ chatDemoRef.current?.updateVariables?.(newVariables);
7265
7276
  }
7266
7277
  }),
7267
7278
  [sendStatus, history]
@@ -8842,6 +8853,17 @@ var ChatButton = forwardRef8(
8842
8853
  internalRef.current.setInputText(text);
8843
8854
  }
8844
8855
  }, 100);
8856
+ },
8857
+ stopGeneration: () => {
8858
+ internalRef.current?.stopGeneration?.();
8859
+ },
8860
+ close: () => {
8861
+ setIsOpen(false);
8862
+ },
8863
+ getMidVal: () => internalRef.current?.getMidVal?.(),
8864
+ getVariables: () => internalRef.current?.getVariables?.(),
8865
+ updateVariables: (newVariables) => {
8866
+ internalRef.current?.updateVariables?.(newVariables);
8845
8867
  }
8846
8868
  }), [isOpen]);
8847
8869
  useEffect13(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icos-react/largemodel",
3
3
  "displayName": "大模型组件",
4
- "version": "1.0.28",
4
+ "version": "1.0.29",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",