@assistant-ui/react 0.5.91 → 0.5.92

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  toLanguageModelMessages,
11
11
  toLanguageModelTools,
12
12
  toolResultStream
13
- } from "./chunk-C57XMNDQ.mjs";
13
+ } from "./chunk-R4FHI4M6.mjs";
14
14
  import {
15
15
  __export
16
16
  } from "./chunk-BJPOCE4O.mjs";
@@ -4232,7 +4232,12 @@ var EdgeChatAdapter = class {
4232
4232
  constructor(options) {
4233
4233
  this.options = options;
4234
4234
  }
4235
- async *run({ messages: messages2, abortSignal, config }) {
4235
+ async *run({
4236
+ messages: messages2,
4237
+ abortSignal,
4238
+ config,
4239
+ unstable_assistantMessageId
4240
+ }) {
4236
4241
  const headers = new Headers(this.options.headers);
4237
4242
  headers.set("Content-Type", "application/json");
4238
4243
  const result = await fetch(this.options.api, {
@@ -4241,8 +4246,11 @@ var EdgeChatAdapter = class {
4241
4246
  credentials: this.options.credentials ?? "same-origin",
4242
4247
  body: JSON.stringify({
4243
4248
  system: config.system,
4244
- messages: toCoreMessages(messages2),
4249
+ messages: toCoreMessages(messages2, {
4250
+ unstable_includeId: this.options.unstable_sendMessageIds
4251
+ }),
4245
4252
  tools: config.tools ? toLanguageModelTools(config.tools) : [],
4253
+ unstable_assistantMessageId,
4246
4254
  ...config.callSettings,
4247
4255
  ...config.config,
4248
4256
  ...this.options.body
@@ -4577,7 +4585,8 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
4577
4585
  messages: messages2,
4578
4586
  abortSignal: this.abortController.signal,
4579
4587
  config: this.getModelConfig(),
4580
- onUpdate: updateMessage
4588
+ onUpdate: updateMessage,
4589
+ unstable_assistantMessageId: message.id
4581
4590
  });
4582
4591
  if (Symbol.asyncIterator in promiseOrGenerator) {
4583
4592
  for await (const r of promiseOrGenerator) {