@zero-library/chat-agent 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.mts CHANGED
@@ -333,14 +333,15 @@ interface Props {
333
333
  }
334
334
  interface ChatHandle {
335
335
  sendMessage: (message?: string, files?: InputFile[]) => void;
336
- switchAgentConversation: (agentId: AgentInfo['id'], strategy?: ConversationStrategy) => void;
337
- switchConversation: (id?: Conversation['id']) => void;
336
+ switchAgentConversation: (agentId: AgentInfo['id'], strategy?: ConversationStrategy) => Promise<void>;
337
+ switchConversation: (id?: Conversation['id']) => Promise<void>;
338
338
  createConversation: () => Promise<void>;
339
339
  setReferences: (references?: ReferencesType) => void;
340
340
  setMessage: (message?: string) => void;
341
341
  setFiles: (files?: InputFile[]) => void;
342
+ setParams: (params?: ChatParams) => void;
342
343
  senderFocus: ChatSenderHandle['focus'];
343
344
  }
344
345
  declare const _default: react.ForwardRefExoticComponent<Props & react.RefAttributes<ChatHandle>>;
345
346
 
346
- export { type AgentInfo, type ChatConfig, _default as ChatCopilot, type ChatHandle, type ChatLayout };
347
+ export { type AgentInfo, type ChatConfig, _default as ChatCopilot, type ChatHandle, type ChatLayout, type InputFile };
package/dist/index.d.ts CHANGED
@@ -333,14 +333,15 @@ interface Props {
333
333
  }
334
334
  interface ChatHandle {
335
335
  sendMessage: (message?: string, files?: InputFile[]) => void;
336
- switchAgentConversation: (agentId: AgentInfo['id'], strategy?: ConversationStrategy) => void;
337
- switchConversation: (id?: Conversation['id']) => void;
336
+ switchAgentConversation: (agentId: AgentInfo['id'], strategy?: ConversationStrategy) => Promise<void>;
337
+ switchConversation: (id?: Conversation['id']) => Promise<void>;
338
338
  createConversation: () => Promise<void>;
339
339
  setReferences: (references?: ReferencesType) => void;
340
340
  setMessage: (message?: string) => void;
341
341
  setFiles: (files?: InputFile[]) => void;
342
+ setParams: (params?: ChatParams) => void;
342
343
  senderFocus: ChatSenderHandle['focus'];
343
344
  }
344
345
  declare const _default: react.ForwardRefExoticComponent<Props & react.RefAttributes<ChatHandle>>;
345
346
 
346
- export { type AgentInfo, type ChatConfig, _default as ChatCopilot, type ChatHandle, type ChatLayout };
347
+ export { type AgentInfo, type ChatConfig, _default as ChatCopilot, type ChatHandle, type ChatLayout, type InputFile };
package/dist/index.esm.js CHANGED
@@ -419,7 +419,7 @@ function createChatStore() {
419
419
  const defaultLayout = receiverType === 3 ? defaultAgentLayout : defaultExpertLayout;
420
420
  config.layout = deepMerge(defaultLayout, layout);
421
421
  };
422
- const setConfigParams = (params = {}) => {
422
+ const setParams = (params = {}) => {
423
423
  config.params = { ...params };
424
424
  };
425
425
  const setHooks = (hooks = {}) => {
@@ -878,7 +878,7 @@ function createChatStore() {
878
878
  setPreview,
879
879
  setLayout,
880
880
  setHooks,
881
- setConfigParams,
881
+ setParams,
882
882
  setUserInfo,
883
883
  character,
884
884
  getCharacters,
@@ -1854,7 +1854,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
1854
1854
  chatStore.setLayout(layout, config?.receiverType);
1855
1855
  }, [layout, config?.receiverType]);
1856
1856
  useEffect(() => {
1857
- chatStore.setConfigParams(params);
1857
+ chatStore.setParams(params);
1858
1858
  }, [params]);
1859
1859
  useEffect(() => {
1860
1860
  chatStore.setHooks(hooks);
@@ -1871,6 +1871,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
1871
1871
  setReferences: chatStore.setReferences,
1872
1872
  setMessage: chatStore.setContent,
1873
1873
  setFiles: chatStore.setFileList,
1874
+ setParams: chatStore.setParams,
1874
1875
  senderFocus: (options) => {
1875
1876
  senderRef.current?.focus(options);
1876
1877
  }