@assistant-ui/react 0.0.25 → 0.0.26

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/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  `assistant-ui` is a set of React components for AI chat.
4
4
 
5
+ - [Discord](https://discord.gg/S9dwgCNEFs)
5
6
  - [Website](https://assistant-ui.com/)
6
7
  - [Demo](https://assistant-ui-rsc-example.vercel.app/)
7
8
 
package/dist/index.js CHANGED
@@ -1812,15 +1812,17 @@ var LocalRuntime = class {
1812
1812
  this.abortController = new AbortController();
1813
1813
  this.notifySubscribers();
1814
1814
  try {
1815
- await this.adapter.run({
1815
+ const updateHandler = ({ content }) => {
1816
+ message.content = content;
1817
+ this.repository.addOrUpdateMessage(parentId, { ...message });
1818
+ this.notifySubscribers();
1819
+ };
1820
+ const result = await this.adapter.run({
1816
1821
  messages,
1817
1822
  abortSignal: this.abortController.signal,
1818
- onUpdate: ({ content }) => {
1819
- message.content = content;
1820
- this.repository.addOrUpdateMessage(parentId, { ...message });
1821
- this.notifySubscribers();
1822
- }
1823
+ onUpdate: updateHandler
1823
1824
  });
1825
+ updateHandler(result);
1824
1826
  message.status = "done";
1825
1827
  this.repository.addOrUpdateMessage(parentId, { ...message });
1826
1828
  } catch (e) {