@assistant-ui/react 0.5.32 → 0.5.33
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 +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
@@ -200,6 +200,9 @@ declare const streamUtils: {
|
|
200
200
|
|
201
201
|
type EdgeChatAdapterOptions = {
|
202
202
|
api: string;
|
203
|
+
credentials?: RequestCredentials;
|
204
|
+
headers?: Record<string, string> | Headers;
|
205
|
+
body?: object;
|
203
206
|
};
|
204
207
|
declare class EdgeChatAdapter implements ChatModelAdapter {
|
205
208
|
private options;
|
package/dist/index.d.ts
CHANGED
@@ -200,6 +200,9 @@ declare const streamUtils: {
|
|
200
200
|
|
201
201
|
type EdgeChatAdapterOptions = {
|
202
202
|
api: string;
|
203
|
+
credentials?: RequestCredentials;
|
204
|
+
headers?: Record<string, string> | Headers;
|
205
|
+
body?: object;
|
203
206
|
};
|
204
207
|
declare class EdgeChatAdapter implements ChatModelAdapter {
|
205
208
|
private options;
|
package/dist/index.js
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
|
-
|
1030
|
-
},
|
1030
|
+
headers,
|
1031
|
+
credentials: _nullishCoalesce(this.options.credentials, () => ( "same-origin")),
|
1031
1032
|
body: JSON.stringify({
|
1032
1033
|
system: config.system,
|
1033
1034
|
messages: _chunkCTVBRM6Cjs.toCoreMessages.call(void 0, messages),
|
1034
1035
|
tools: config.tools ? _chunkCTVBRM6Cjs.toLanguageModelTools.call(void 0, config.tools) : [],
|
1035
1036
|
...config.callSettings,
|
1036
|
-
...config.config
|
1037
|
+
...config.config,
|
1038
|
+
...this.options.body
|
1037
1039
|
}),
|
1038
1040
|
signal: abortSignal
|
1039
1041
|
});
|