@assistant-ui/react 0.5.32 → 0.5.33

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -1023,17 +1023,19 @@ var EdgeChatAdapter = class {
1023
1023
  this.options = options;
1024
1024
  }
1025
1025
  async *run({ messages, abortSignal, config }) {
1026
+ const headers = new Headers(this.options.headers);
1027
+ headers.set("Content-Type", "application/json");
1026
1028
  const result = await fetch(this.options.api, {
1027
1029
  method: "POST",
1028
- headers: {
1029
- "Content-Type": "application/json"
1030
- },
1030
+ headers,
1031
+ credentials: this.options.credentials ?? "same-origin",
1031
1032
  body: JSON.stringify({
1032
1033
  system: config.system,
1033
1034
  messages: toCoreMessages(messages),
1034
1035
  tools: config.tools ? toLanguageModelTools(config.tools) : [],
1035
1036
  ...config.callSettings,
1036
- ...config.config
1037
+ ...config.config,
1038
+ ...this.options.body
1037
1039
  }),
1038
1040
  signal: abortSignal
1039
1041
  });