@assistant-ui/react 0.5.71 → 0.5.72
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
@@ -455,7 +455,7 @@ declare class EdgeChatAdapter implements ChatModelAdapter {
|
|
455
455
|
}
|
456
456
|
|
457
457
|
type EdgeRuntimeOptions = EdgeChatAdapterOptions & LocalRuntimeOptions;
|
458
|
-
declare const useEdgeRuntime: (
|
458
|
+
declare const useEdgeRuntime: (options: EdgeRuntimeOptions) => LocalRuntime;
|
459
459
|
|
460
460
|
type ThreadMessageLike = {
|
461
461
|
role: "assistant" | "user" | "system";
|
@@ -519,7 +519,7 @@ declare const useExternalMessageConverter: <T extends WeakKey>({ callback, messa
|
|
519
519
|
type DangerousInBrowserAdapterOptions = CreateEdgeRuntimeAPIOptions;
|
520
520
|
|
521
521
|
type DangerousInBrowserRuntimeOptions = DangerousInBrowserAdapterOptions & LocalRuntimeOptions;
|
522
|
-
declare const useDangerousInBrowserRuntime: (
|
522
|
+
declare const useDangerousInBrowserRuntime: (options: DangerousInBrowserRuntimeOptions) => LocalRuntime;
|
523
523
|
|
524
524
|
type Subscribable = {
|
525
525
|
subscribe: (callback: () => void) => Unsubscribe;
|
package/dist/index.d.ts
CHANGED
@@ -455,7 +455,7 @@ declare class EdgeChatAdapter implements ChatModelAdapter {
|
|
455
455
|
}
|
456
456
|
|
457
457
|
type EdgeRuntimeOptions = EdgeChatAdapterOptions & LocalRuntimeOptions;
|
458
|
-
declare const useEdgeRuntime: (
|
458
|
+
declare const useEdgeRuntime: (options: EdgeRuntimeOptions) => LocalRuntime;
|
459
459
|
|
460
460
|
type ThreadMessageLike = {
|
461
461
|
role: "assistant" | "user" | "system";
|
@@ -519,7 +519,7 @@ declare const useExternalMessageConverter: <T extends WeakKey>({ callback, messa
|
|
519
519
|
type DangerousInBrowserAdapterOptions = CreateEdgeRuntimeAPIOptions;
|
520
520
|
|
521
521
|
type DangerousInBrowserRuntimeOptions = DangerousInBrowserAdapterOptions & LocalRuntimeOptions;
|
522
|
-
declare const useDangerousInBrowserRuntime: (
|
522
|
+
declare const useDangerousInBrowserRuntime: (options: DangerousInBrowserRuntimeOptions) => LocalRuntime;
|
523
523
|
|
524
524
|
type Subscribable = {
|
525
525
|
subscribe: (callback: () => void) => Unsubscribe;
|
package/dist/index.js
CHANGED
@@ -3978,19 +3978,20 @@ var EdgeChatAdapter = class {
|
|
3978
3978
|
}
|
3979
3979
|
};
|
3980
3980
|
|
3981
|
+
// src/runtimes/local/LocalRuntimeOptions.tsx
|
3982
|
+
var splitLocalRuntimeOptions = (options) => {
|
3983
|
+
const { initialMessages, maxToolRoundtrips, adapters, ...rest } = options;
|
3984
|
+
return {
|
3985
|
+
localRuntimeOptions: { initialMessages, maxToolRoundtrips, adapters },
|
3986
|
+
otherOptions: rest
|
3987
|
+
};
|
3988
|
+
};
|
3989
|
+
|
3981
3990
|
// src/runtimes/edge/useEdgeRuntime.ts
|
3982
|
-
var useEdgeRuntime = ({
|
3983
|
-
|
3984
|
-
|
3985
|
-
|
3986
|
-
...options
|
3987
|
-
}) => {
|
3988
|
-
const [adapter] = _react.useState.call(void 0, () => new EdgeChatAdapter(options));
|
3989
|
-
return useLocalRuntime(adapter, {
|
3990
|
-
initialMessages,
|
3991
|
-
maxToolRoundtrips,
|
3992
|
-
adapters
|
3993
|
-
});
|
3991
|
+
var useEdgeRuntime = (options) => {
|
3992
|
+
const { localRuntimeOptions, otherOptions } = splitLocalRuntimeOptions(options);
|
3993
|
+
const [adapter] = _react.useState.call(void 0, () => new EdgeChatAdapter(otherOptions));
|
3994
|
+
return useLocalRuntime(adapter, localRuntimeOptions);
|
3994
3995
|
};
|
3995
3996
|
|
3996
3997
|
// src/runtimes/local/shouldContinue.tsx
|
@@ -4920,12 +4921,10 @@ var DangerousInBrowserAdapter = class {
|
|
4920
4921
|
};
|
4921
4922
|
|
4922
4923
|
// src/runtimes/dangerous-in-browser/useDangerousInBrowserRuntime.ts
|
4923
|
-
var useDangerousInBrowserRuntime = ({
|
4924
|
-
|
4925
|
-
|
4926
|
-
|
4927
|
-
const [adapter] = _react.useState.call(void 0, () => new DangerousInBrowserAdapter(options));
|
4928
|
-
return useLocalRuntime(adapter, { initialMessages });
|
4924
|
+
var useDangerousInBrowserRuntime = (options) => {
|
4925
|
+
const { localRuntimeOptions, otherOptions } = splitLocalRuntimeOptions(options);
|
4926
|
+
const [adapter] = _react.useState.call(void 0, () => new DangerousInBrowserAdapter(otherOptions));
|
4927
|
+
return useLocalRuntime(adapter, localRuntimeOptions);
|
4929
4928
|
};
|
4930
4929
|
|
4931
4930
|
// src/runtimes/speech/WebSpeechSynthesisAdapter.ts
|