@mastra/playground-ui 5.1.11-alpha.4 → 5.1.12-alpha.0
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.cjs.js +118 -115
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +118 -115
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/assistant-ui/network-threads.d.ts +1 -2
- package/dist/src/components/assistant-ui/thread.d.ts +1 -2
- package/dist/src/domains/agents/components/agent-chat.d.ts +1 -1
- package/dist/src/domains/agents/components/agent-settings.d.ts +1 -0
- package/dist/src/domains/agents/context/agent-context.d.ts +4 -6
- package/dist/src/domains/agents/hooks/use-agent-settings-state.d.ts +10 -0
- package/dist/src/domains/agents/index.d.ts +1 -1
- package/dist/src/services/mastra-runtime-provider.d.ts +1 -1
- package/dist/src/services/network-runtime-provider.d.ts +5 -3
- package/dist/src/types.d.ts +5 -3
- package/package.json +3 -3
- package/dist/src/domains/agents/components/agent-model-settings.d.ts +0 -1
- package/dist/src/domains/agents/hooks/use-agent-model-settings-state.d.ts +0 -15
package/dist/index.cjs.js
CHANGED
|
@@ -4848,7 +4848,7 @@ const ComposerAttachments = () => {
|
|
|
4848
4848
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full flex-row items-center gap-4 pb-2", children: /* @__PURE__ */ jsxRuntime.jsx(react.ComposerPrimitive.Attachments, { components: { Attachment: AttachmentThumbnail } }) });
|
|
4849
4849
|
};
|
|
4850
4850
|
|
|
4851
|
-
const Thread = ({ ToolFallback, agentName, hasMemory
|
|
4851
|
+
const Thread = ({ ToolFallback, agentName, hasMemory }) => {
|
|
4852
4852
|
const areaRef = React.useRef(null);
|
|
4853
4853
|
useAutoscroll(areaRef, { enabled: true });
|
|
4854
4854
|
const WrappedAssistantMessage = (props) => {
|
|
@@ -4869,7 +4869,7 @@ const Thread = ({ ToolFallback, agentName, hasMemory, showFileSupport }) => {
|
|
|
4869
4869
|
) }),
|
|
4870
4870
|
/* @__PURE__ */ jsxRuntime.jsx(react.ThreadPrimitive.If, { empty: false, children: /* @__PURE__ */ jsxRuntime.jsx("div", {}) })
|
|
4871
4871
|
] }),
|
|
4872
|
-
/* @__PURE__ */ jsxRuntime.jsx(Composer$1, { hasMemory
|
|
4872
|
+
/* @__PURE__ */ jsxRuntime.jsx(Composer$1, { hasMemory })
|
|
4873
4873
|
] });
|
|
4874
4874
|
};
|
|
4875
4875
|
const ThreadWrapper$1 = ({ children }) => {
|
|
@@ -4891,7 +4891,7 @@ const ThreadWelcome$1 = ({ agentName }) => {
|
|
|
4891
4891
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-4 font-medium", children: "How can I help you today?" })
|
|
4892
4892
|
] }) });
|
|
4893
4893
|
};
|
|
4894
|
-
const Composer$1 = ({ hasMemory
|
|
4894
|
+
const Composer$1 = ({ hasMemory }) => {
|
|
4895
4895
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-4", children: [
|
|
4896
4896
|
/* @__PURE__ */ jsxRuntime.jsxs(react.ComposerPrimitive.Root, { children: [
|
|
4897
4897
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-[568px] w-full mx-auto pb-2", children: /* @__PURE__ */ jsxRuntime.jsx(ComposerAttachments, {}) }),
|
|
@@ -4908,7 +4908,7 @@ const Composer$1 = ({ hasMemory, showFileSupport }) => {
|
|
|
4908
4908
|
) }),
|
|
4909
4909
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
4910
4910
|
/* @__PURE__ */ jsxRuntime.jsx(SpeechInput$1, {}),
|
|
4911
|
-
/* @__PURE__ */ jsxRuntime.jsx(ComposerAction$1, {
|
|
4911
|
+
/* @__PURE__ */ jsxRuntime.jsx(ComposerAction$1, {})
|
|
4912
4912
|
] })
|
|
4913
4913
|
] })
|
|
4914
4914
|
] }),
|
|
@@ -4937,9 +4937,9 @@ const SpeechInput$1 = () => {
|
|
|
4937
4937
|
}
|
|
4938
4938
|
);
|
|
4939
4939
|
};
|
|
4940
|
-
const ComposerAction$1 = (
|
|
4940
|
+
const ComposerAction$1 = () => {
|
|
4941
4941
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4942
|
-
|
|
4942
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.ComposerPrimitive.AddAttachment, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipIconButton, { tooltip: "Add attachment", variant: "ghost", className: "rounded-full", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { className: "h-6 w-6 text-[#898989] hover:text-[#fff]" }) }) }),
|
|
4943
4943
|
/* @__PURE__ */ jsxRuntime.jsx(react.ThreadPrimitive.If, { running: false, children: /* @__PURE__ */ jsxRuntime.jsx(react.ComposerPrimitive.Send, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4944
4944
|
TooltipIconButton,
|
|
4945
4945
|
{
|
|
@@ -5067,18 +5067,27 @@ function MastraRuntimeProvider({
|
|
|
5067
5067
|
children,
|
|
5068
5068
|
agentId,
|
|
5069
5069
|
initialMessages,
|
|
5070
|
-
agentName,
|
|
5071
5070
|
memory,
|
|
5072
5071
|
threadId,
|
|
5073
5072
|
refreshThreadList,
|
|
5074
|
-
|
|
5075
|
-
chatWithGenerate,
|
|
5073
|
+
settings,
|
|
5076
5074
|
runtimeContext
|
|
5077
5075
|
}) {
|
|
5078
5076
|
const [isRunning, setIsRunning] = React.useState(false);
|
|
5079
5077
|
const [messages, setMessages] = React.useState([]);
|
|
5080
5078
|
const [currentThreadId, setCurrentThreadId] = React.useState(threadId);
|
|
5081
|
-
const {
|
|
5079
|
+
const {
|
|
5080
|
+
frequencyPenalty,
|
|
5081
|
+
presencePenalty,
|
|
5082
|
+
maxRetries,
|
|
5083
|
+
maxSteps,
|
|
5084
|
+
maxTokens,
|
|
5085
|
+
temperature,
|
|
5086
|
+
topK,
|
|
5087
|
+
topP,
|
|
5088
|
+
instructions,
|
|
5089
|
+
chatWithGenerate
|
|
5090
|
+
} = settings?.modelSettings ?? {};
|
|
5082
5091
|
const runtimeContextInstance = new di.RuntimeContext();
|
|
5083
5092
|
Object.entries(runtimeContext ?? {}).forEach(([key, value]) => {
|
|
5084
5093
|
runtimeContextInstance.set(key, value);
|
|
@@ -5384,82 +5393,56 @@ function MastraRuntimeProvider({
|
|
|
5384
5393
|
] });
|
|
5385
5394
|
}
|
|
5386
5395
|
|
|
5387
|
-
const
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5396
|
+
const defaultSettings = {
|
|
5397
|
+
modelSettings: {
|
|
5398
|
+
maxRetries: 2,
|
|
5399
|
+
maxSteps: 5,
|
|
5400
|
+
temperature: 0.5,
|
|
5401
|
+
topP: 1,
|
|
5402
|
+
chatWithGenerate: false
|
|
5403
|
+
}
|
|
5392
5404
|
};
|
|
5393
|
-
function
|
|
5394
|
-
const [
|
|
5395
|
-
const [chatWithGenerate, setChatWithGenerateState] = React.useState(false);
|
|
5405
|
+
function useAgentSettingsState({ agentId }) {
|
|
5406
|
+
const [settings, setSettingsState] = React.useState(void 0);
|
|
5396
5407
|
const LOCAL_STORAGE_KEY = `mastra-agent-store-${agentId}`;
|
|
5397
5408
|
React.useEffect(() => {
|
|
5398
5409
|
try {
|
|
5399
5410
|
const stored = localStorage.getItem(LOCAL_STORAGE_KEY);
|
|
5400
5411
|
if (stored) {
|
|
5401
5412
|
const parsed = JSON.parse(stored);
|
|
5402
|
-
|
|
5403
|
-
setChatWithGenerateState(parsed.chatWithGenerate ?? false);
|
|
5413
|
+
setSettingsState(parsed ?? void 0);
|
|
5404
5414
|
}
|
|
5405
5415
|
} catch (e) {
|
|
5406
5416
|
console.error(e);
|
|
5407
5417
|
}
|
|
5408
5418
|
}, [LOCAL_STORAGE_KEY]);
|
|
5409
|
-
const
|
|
5410
|
-
|
|
5411
|
-
localStorage.setItem(
|
|
5412
|
-
LOCAL_STORAGE_KEY,
|
|
5413
|
-
JSON.stringify({ modelSettings: modelSettingsValue, chatWithGenerate, agentId })
|
|
5414
|
-
);
|
|
5415
|
-
};
|
|
5416
|
-
const setChatWithGenerate = (chatWithGenerateValue) => {
|
|
5417
|
-
setChatWithGenerateState(chatWithGenerateValue);
|
|
5418
|
-
localStorage.setItem(
|
|
5419
|
-
LOCAL_STORAGE_KEY,
|
|
5420
|
-
JSON.stringify({ modelSettings, chatWithGenerate: chatWithGenerateValue, agentId })
|
|
5421
|
-
);
|
|
5419
|
+
const setSettings = (settingsValue) => {
|
|
5420
|
+
setSettingsState((prev) => ({ ...prev, ...settingsValue }));
|
|
5421
|
+
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify({ ...settingsValue, agentId }));
|
|
5422
5422
|
};
|
|
5423
5423
|
const resetAll = () => {
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
localStorage.setItem(
|
|
5427
|
-
LOCAL_STORAGE_KEY,
|
|
5428
|
-
JSON.stringify({ modelSettings: defaultModelSettings$1, chatWithGenerate: false, agentId })
|
|
5429
|
-
);
|
|
5424
|
+
setSettingsState(defaultSettings);
|
|
5425
|
+
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(defaultSettings));
|
|
5430
5426
|
};
|
|
5431
5427
|
return {
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
setModelSettings,
|
|
5435
|
-
setChatWithGenerate,
|
|
5428
|
+
settings,
|
|
5429
|
+
setSettings,
|
|
5436
5430
|
resetAll
|
|
5437
5431
|
};
|
|
5438
5432
|
}
|
|
5439
5433
|
|
|
5440
5434
|
const AgentSettingsContext = React.createContext({});
|
|
5441
5435
|
function AgentSettingsProvider({ children, agentId }) {
|
|
5442
|
-
const {
|
|
5436
|
+
const { settings, setSettings, resetAll } = useAgentSettingsState({
|
|
5443
5437
|
agentId
|
|
5444
5438
|
});
|
|
5445
|
-
const onChangeModelSettings = (modelSettings2) => {
|
|
5446
|
-
setModelSettings(modelSettings2);
|
|
5447
|
-
};
|
|
5448
|
-
const onChangeChatWithGenerate = (chatWithGenerate2) => {
|
|
5449
|
-
setChatWithGenerate(chatWithGenerate2);
|
|
5450
|
-
};
|
|
5451
|
-
const onReset = () => {
|
|
5452
|
-
resetAll();
|
|
5453
|
-
};
|
|
5454
5439
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5455
5440
|
AgentSettingsContext.Provider,
|
|
5456
5441
|
{
|
|
5457
5442
|
value: {
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
chatWithGenerate: chatWithGenerate ?? false,
|
|
5462
|
-
setChatWithGenerate: onChangeChatWithGenerate
|
|
5443
|
+
settings,
|
|
5444
|
+
setSettings,
|
|
5445
|
+
resetAll
|
|
5463
5446
|
},
|
|
5464
5447
|
children
|
|
5465
5448
|
}
|
|
@@ -5481,16 +5464,8 @@ const usePlaygroundStore = zustand.create()(
|
|
|
5481
5464
|
)
|
|
5482
5465
|
);
|
|
5483
5466
|
|
|
5484
|
-
const AgentChat = ({
|
|
5485
|
-
|
|
5486
|
-
agentName,
|
|
5487
|
-
threadId,
|
|
5488
|
-
initialMessages,
|
|
5489
|
-
memory,
|
|
5490
|
-
refreshThreadList,
|
|
5491
|
-
showFileSupport
|
|
5492
|
-
}) => {
|
|
5493
|
-
const { modelSettings, chatWithGenerate } = useAgentSettings();
|
|
5467
|
+
const AgentChat = ({ agentId, agentName, threadId, initialMessages, memory, refreshThreadList }) => {
|
|
5468
|
+
const { settings } = useAgentSettings();
|
|
5494
5469
|
const { runtimeContext } = usePlaygroundStore();
|
|
5495
5470
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5496
5471
|
MastraRuntimeProvider,
|
|
@@ -5501,10 +5476,9 @@ const AgentChat = ({
|
|
|
5501
5476
|
initialMessages,
|
|
5502
5477
|
memory,
|
|
5503
5478
|
refreshThreadList,
|
|
5504
|
-
|
|
5505
|
-
chatWithGenerate,
|
|
5479
|
+
settings,
|
|
5506
5480
|
runtimeContext,
|
|
5507
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Thread, { agentName: agentName ?? "", hasMemory: memory
|
|
5481
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Thread, { agentName: agentName ?? "", hasMemory: memory })
|
|
5508
5482
|
}
|
|
5509
5483
|
);
|
|
5510
5484
|
};
|
|
@@ -6736,7 +6710,7 @@ const CollapsibleTrigger = CollapsiblePrimitive__namespace.CollapsibleTrigger;
|
|
|
6736
6710
|
const CollapsibleContent = CollapsiblePrimitive__namespace.CollapsibleContent;
|
|
6737
6711
|
|
|
6738
6712
|
const AgentAdvancedSettings = () => {
|
|
6739
|
-
const {
|
|
6713
|
+
const { settings, setSettings } = useAgentSettings();
|
|
6740
6714
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
6741
6715
|
const collapsibleClassName = "rounded-lg border-sm border-border1 bg-surface3 overflow-clip";
|
|
6742
6716
|
const collapsibleTriggerClassName = "text-icon3 text-ui-lg font-medium flex items-center gap-2 w-full p-[10px] justify-between";
|
|
@@ -6754,8 +6728,14 @@ const AgentAdvancedSettings = () => {
|
|
|
6754
6728
|
{
|
|
6755
6729
|
id: "top-k",
|
|
6756
6730
|
type: "number",
|
|
6757
|
-
value: modelSettings?.topK || "",
|
|
6758
|
-
onChange: (e) =>
|
|
6731
|
+
value: settings?.modelSettings?.topK || "",
|
|
6732
|
+
onChange: (e) => setSettings({
|
|
6733
|
+
...settings,
|
|
6734
|
+
modelSettings: {
|
|
6735
|
+
...settings?.modelSettings,
|
|
6736
|
+
topK: e.target.value ? Number(e.target.value) : void 0
|
|
6737
|
+
}
|
|
6738
|
+
})
|
|
6759
6739
|
}
|
|
6760
6740
|
)
|
|
6761
6741
|
] }),
|
|
@@ -6766,10 +6746,13 @@ const AgentAdvancedSettings = () => {
|
|
|
6766
6746
|
{
|
|
6767
6747
|
id: "frequency-penalty",
|
|
6768
6748
|
type: "number",
|
|
6769
|
-
value: modelSettings?.frequencyPenalty || "",
|
|
6770
|
-
onChange: (e) =>
|
|
6771
|
-
...
|
|
6772
|
-
|
|
6749
|
+
value: settings?.modelSettings?.frequencyPenalty || "",
|
|
6750
|
+
onChange: (e) => setSettings({
|
|
6751
|
+
...settings,
|
|
6752
|
+
modelSettings: {
|
|
6753
|
+
...settings?.modelSettings,
|
|
6754
|
+
frequencyPenalty: e.target.value ? Number(e.target.value) : void 0
|
|
6755
|
+
}
|
|
6773
6756
|
})
|
|
6774
6757
|
}
|
|
6775
6758
|
)
|
|
@@ -6781,10 +6764,13 @@ const AgentAdvancedSettings = () => {
|
|
|
6781
6764
|
{
|
|
6782
6765
|
id: "presence-penalty",
|
|
6783
6766
|
type: "number",
|
|
6784
|
-
value: modelSettings?.presencePenalty || "",
|
|
6785
|
-
onChange: (e) =>
|
|
6786
|
-
...
|
|
6787
|
-
|
|
6767
|
+
value: settings?.modelSettings?.presencePenalty || "",
|
|
6768
|
+
onChange: (e) => setSettings({
|
|
6769
|
+
...settings,
|
|
6770
|
+
modelSettings: {
|
|
6771
|
+
...settings?.modelSettings,
|
|
6772
|
+
presencePenalty: e.target.value ? Number(e.target.value) : void 0
|
|
6773
|
+
}
|
|
6788
6774
|
})
|
|
6789
6775
|
}
|
|
6790
6776
|
)
|
|
@@ -6796,10 +6782,13 @@ const AgentAdvancedSettings = () => {
|
|
|
6796
6782
|
{
|
|
6797
6783
|
id: "max-tokens",
|
|
6798
6784
|
type: "number",
|
|
6799
|
-
value: modelSettings?.maxTokens || "",
|
|
6800
|
-
onChange: (e) =>
|
|
6801
|
-
...
|
|
6802
|
-
|
|
6785
|
+
value: settings?.modelSettings?.maxTokens || "",
|
|
6786
|
+
onChange: (e) => setSettings({
|
|
6787
|
+
...settings,
|
|
6788
|
+
modelSettings: {
|
|
6789
|
+
...settings?.modelSettings,
|
|
6790
|
+
maxTokens: e.target.value ? Number(e.target.value) : void 0
|
|
6791
|
+
}
|
|
6803
6792
|
})
|
|
6804
6793
|
}
|
|
6805
6794
|
)
|
|
@@ -6811,10 +6800,13 @@ const AgentAdvancedSettings = () => {
|
|
|
6811
6800
|
{
|
|
6812
6801
|
id: "max-steps",
|
|
6813
6802
|
type: "number",
|
|
6814
|
-
value: modelSettings?.maxSteps || "",
|
|
6815
|
-
onChange: (e) =>
|
|
6816
|
-
...
|
|
6817
|
-
|
|
6803
|
+
value: settings?.modelSettings?.maxSteps || "",
|
|
6804
|
+
onChange: (e) => setSettings({
|
|
6805
|
+
...settings,
|
|
6806
|
+
modelSettings: {
|
|
6807
|
+
...settings?.modelSettings,
|
|
6808
|
+
maxSteps: e.target.value ? Number(e.target.value) : void 0
|
|
6809
|
+
}
|
|
6818
6810
|
})
|
|
6819
6811
|
}
|
|
6820
6812
|
)
|
|
@@ -6826,10 +6818,13 @@ const AgentAdvancedSettings = () => {
|
|
|
6826
6818
|
{
|
|
6827
6819
|
id: "max-retries",
|
|
6828
6820
|
type: "number",
|
|
6829
|
-
value: modelSettings?.maxRetries || "",
|
|
6830
|
-
onChange: (e) =>
|
|
6831
|
-
...
|
|
6832
|
-
|
|
6821
|
+
value: settings?.modelSettings?.maxRetries || "",
|
|
6822
|
+
onChange: (e) => setSettings({
|
|
6823
|
+
...settings,
|
|
6824
|
+
modelSettings: {
|
|
6825
|
+
...settings?.modelSettings,
|
|
6826
|
+
maxRetries: e.target.value ? Number(e.target.value) : void 0
|
|
6827
|
+
}
|
|
6833
6828
|
})
|
|
6834
6829
|
}
|
|
6835
6830
|
)
|
|
@@ -6838,16 +6833,19 @@ const AgentAdvancedSettings = () => {
|
|
|
6838
6833
|
] });
|
|
6839
6834
|
};
|
|
6840
6835
|
|
|
6841
|
-
|
|
6842
|
-
const {
|
|
6836
|
+
const AgentSettings = () => {
|
|
6837
|
+
const { settings, setSettings, resetAll } = useAgentSettings();
|
|
6843
6838
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-5 text-xs py-2 pb-4", children: [
|
|
6844
6839
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-7", children: [
|
|
6845
6840
|
/* @__PURE__ */ jsxRuntime.jsx(Entry, { label: "Chat Method", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6846
6841
|
RadioGroup,
|
|
6847
6842
|
{
|
|
6848
6843
|
orientation: "horizontal",
|
|
6849
|
-
value: chatWithGenerate ? "generate" : "stream",
|
|
6850
|
-
onValueChange: (value) =>
|
|
6844
|
+
value: settings?.modelSettings?.chatWithGenerate ? "generate" : "stream",
|
|
6845
|
+
onValueChange: (value) => setSettings({
|
|
6846
|
+
...settings,
|
|
6847
|
+
modelSettings: { ...settings?.modelSettings, chatWithGenerate: value === "generate" }
|
|
6848
|
+
}),
|
|
6851
6849
|
className: "flex flex-row gap-4",
|
|
6852
6850
|
children: [
|
|
6853
6851
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -6866,37 +6864,43 @@ function AgentModelSettings() {
|
|
|
6866
6864
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6867
6865
|
Slider,
|
|
6868
6866
|
{
|
|
6869
|
-
value: [modelSettings?.temperature ?? -0.1],
|
|
6867
|
+
value: [settings?.modelSettings?.temperature ?? -0.1],
|
|
6870
6868
|
max: 1,
|
|
6871
6869
|
min: -0.1,
|
|
6872
6870
|
step: 0.1,
|
|
6873
|
-
onValueChange: (value) =>
|
|
6871
|
+
onValueChange: (value) => setSettings({
|
|
6872
|
+
...settings,
|
|
6873
|
+
modelSettings: { ...settings?.modelSettings, temperature: value[0] < 0 ? void 0 : value[0] }
|
|
6874
|
+
})
|
|
6874
6875
|
}
|
|
6875
6876
|
),
|
|
6876
|
-
/* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "p", variant: "ui-sm", className: "text-icon3", children: modelSettings?.temperature ?? "n/a" })
|
|
6877
|
+
/* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "p", variant: "ui-sm", className: "text-icon3", children: settings?.modelSettings?.temperature ?? "n/a" })
|
|
6877
6878
|
] }) }),
|
|
6878
6879
|
/* @__PURE__ */ jsxRuntime.jsx(Entry, { label: "Top P", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row justify-between items-center gap-2", children: [
|
|
6879
6880
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6880
6881
|
Slider,
|
|
6881
6882
|
{
|
|
6882
|
-
onValueChange: (value) =>
|
|
6883
|
-
|
|
6883
|
+
onValueChange: (value) => setSettings({
|
|
6884
|
+
...settings,
|
|
6885
|
+
modelSettings: { ...settings?.modelSettings, topP: value[0] < 0 ? void 0 : value[0] }
|
|
6886
|
+
}),
|
|
6887
|
+
value: [settings?.modelSettings?.topP ?? -0.1],
|
|
6884
6888
|
max: 1,
|
|
6885
6889
|
min: -0.1,
|
|
6886
6890
|
step: 0.1
|
|
6887
6891
|
}
|
|
6888
6892
|
),
|
|
6889
|
-
/* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "p", variant: "ui-sm", className: "text-icon3", children: modelSettings?.topP ?? "n/a" })
|
|
6893
|
+
/* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "p", variant: "ui-sm", className: "text-icon3", children: settings?.modelSettings?.topP ?? "n/a" })
|
|
6890
6894
|
] }) })
|
|
6891
6895
|
] })
|
|
6892
6896
|
] }),
|
|
6893
6897
|
/* @__PURE__ */ jsxRuntime.jsx("section", { className: "py-7", children: /* @__PURE__ */ jsxRuntime.jsx(AgentAdvancedSettings, {}) }),
|
|
6894
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: () =>
|
|
6898
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: () => resetAll(), variant: "light", className: "w-full", size: "lg", children: [
|
|
6895
6899
|
/* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, {}) }),
|
|
6896
6900
|
"Reset"
|
|
6897
6901
|
] })
|
|
6898
6902
|
] });
|
|
6899
|
-
}
|
|
6903
|
+
};
|
|
6900
6904
|
|
|
6901
6905
|
const convertMessage$1 = (message) => {
|
|
6902
6906
|
return message;
|
|
@@ -6907,8 +6911,7 @@ function MastraNetworkRuntimeProvider({
|
|
|
6907
6911
|
initialMessages,
|
|
6908
6912
|
memory,
|
|
6909
6913
|
threadId,
|
|
6910
|
-
|
|
6911
|
-
modelSettings = {}
|
|
6914
|
+
modelSettings
|
|
6912
6915
|
}) {
|
|
6913
6916
|
const [isRunning, setIsRunning] = React.useState(false);
|
|
6914
6917
|
const [messages, setMessages] = React.useState(initialMessages || []);
|
|
@@ -9388,7 +9391,7 @@ const AssistantActionBar = () => {
|
|
|
9388
9391
|
);
|
|
9389
9392
|
};
|
|
9390
9393
|
|
|
9391
|
-
const NetworkThread = ({ ToolFallback, networkName, hasMemory
|
|
9394
|
+
const NetworkThread = ({ ToolFallback, networkName, hasMemory }) => {
|
|
9392
9395
|
const areaRef = React.useRef(null);
|
|
9393
9396
|
useAutoscroll(areaRef, { enabled: true });
|
|
9394
9397
|
const WrappedAssistantMessage = (props) => {
|
|
@@ -9411,7 +9414,7 @@ const NetworkThread = ({ ToolFallback, networkName, hasMemory, showFileSupport }
|
|
|
9411
9414
|
] }),
|
|
9412
9415
|
/* @__PURE__ */ jsxRuntime.jsx(react.ThreadPrimitive.If, { empty: false, children: /* @__PURE__ */ jsxRuntime.jsx("div", {}) })
|
|
9413
9416
|
] }),
|
|
9414
|
-
/* @__PURE__ */ jsxRuntime.jsx(Composer, { hasMemory
|
|
9417
|
+
/* @__PURE__ */ jsxRuntime.jsx(Composer, { hasMemory })
|
|
9415
9418
|
] });
|
|
9416
9419
|
};
|
|
9417
9420
|
const ThreadWrapper = ({ children }) => {
|
|
@@ -9443,7 +9446,7 @@ const ThreadWelcome = ({ networkName }) => {
|
|
|
9443
9446
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-4 font-medium", children: "How can I help you today?" })
|
|
9444
9447
|
] }) });
|
|
9445
9448
|
};
|
|
9446
|
-
const Composer = ({ hasMemory
|
|
9449
|
+
const Composer = ({ hasMemory }) => {
|
|
9447
9450
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
9448
9451
|
/* @__PURE__ */ jsxRuntime.jsxs(react.ComposerPrimitive.Root, { children: [
|
|
9449
9452
|
/* @__PURE__ */ jsxRuntime.jsx(ComposerAttachments, {}),
|
|
@@ -9460,7 +9463,7 @@ const Composer = ({ hasMemory, showFileSupport }) => {
|
|
|
9460
9463
|
) }),
|
|
9461
9464
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9462
9465
|
/* @__PURE__ */ jsxRuntime.jsx(SpeechInput, {}),
|
|
9463
|
-
/* @__PURE__ */ jsxRuntime.jsx(ComposerAction, {
|
|
9466
|
+
/* @__PURE__ */ jsxRuntime.jsx(ComposerAction, {})
|
|
9464
9467
|
] })
|
|
9465
9468
|
] })
|
|
9466
9469
|
] }),
|
|
@@ -9489,9 +9492,9 @@ const SpeechInput = () => {
|
|
|
9489
9492
|
}
|
|
9490
9493
|
);
|
|
9491
9494
|
};
|
|
9492
|
-
const ComposerAction = (
|
|
9495
|
+
const ComposerAction = () => {
|
|
9493
9496
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9494
|
-
|
|
9497
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.ComposerPrimitive.AddAttachment, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipIconButton, { tooltip: "Add attachment", variant: "ghost", className: "rounded-full", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { className: "h-6 w-6 text-[#898989] hover:text-[#fff]" }) }) }),
|
|
9495
9498
|
/* @__PURE__ */ jsxRuntime.jsx(react.ThreadPrimitive.If, { running: false, children: /* @__PURE__ */ jsxRuntime.jsx(react.ComposerPrimitive.Send, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9496
9499
|
TooltipIconButton,
|
|
9497
9500
|
{
|
|
@@ -11962,8 +11965,8 @@ exports.AgentChat = AgentChat;
|
|
|
11962
11965
|
exports.AgentCoinIcon = AgentCoinIcon;
|
|
11963
11966
|
exports.AgentEvals = AgentEvals;
|
|
11964
11967
|
exports.AgentIcon = AgentIcon;
|
|
11965
|
-
exports.AgentModelSettings = AgentModelSettings;
|
|
11966
11968
|
exports.AgentNetworkCoinIcon = AgentNetworkCoinIcon;
|
|
11969
|
+
exports.AgentSettings = AgentSettings;
|
|
11967
11970
|
exports.AgentSettingsContext = AgentSettingsContext;
|
|
11968
11971
|
exports.AgentSettingsProvider = AgentSettingsProvider;
|
|
11969
11972
|
exports.AgentTraces = AgentTraces;
|