@copart/ops-tool-kit 1.10.20-alpha.17 → 1.10.20-alpha.18
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/ops-tool-kit.js +31 -10
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +1 -1
package/dist/ops-tool-kit.js
CHANGED
|
@@ -33,7 +33,7 @@ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
|
33
33
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
34
34
|
|
|
35
35
|
const name$f = "@copart/ops-tool-kit";
|
|
36
|
-
const version$5 = "1.10.20-alpha.
|
|
36
|
+
const version$5 = "1.10.20-alpha.18";
|
|
37
37
|
const main$1 = "dist/ops-tool-kit.js";
|
|
38
38
|
const style = "dist/ops-tool-kit.css";
|
|
39
39
|
const files = [
|
|
@@ -55655,10 +55655,14 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
55655
55655
|
_ref.collection;
|
|
55656
55656
|
var _ref$systemPrompt = _ref.systemPrompt,
|
|
55657
55657
|
systemPrompt = _ref$systemPrompt === void 0 ? '' : _ref$systemPrompt,
|
|
55658
|
+
_ref$contextChangePro = _ref.contextChangePrompt,
|
|
55659
|
+
contextChangePrompt = _ref$contextChangePro === void 0 ? '' : _ref$contextChangePro,
|
|
55658
55660
|
_ref$contextMessagesC = _ref.contextMessagesCount,
|
|
55659
55661
|
contextMessagesCount = _ref$contextMessagesC === void 0 ? 5 : _ref$contextMessagesC,
|
|
55662
|
+
_ref$contextTopMessag = _ref.contextTopMessagesCount,
|
|
55663
|
+
contextTopMessagesCount = _ref$contextTopMessag === void 0 ? 10 : _ref$contextTopMessag,
|
|
55660
55664
|
_ref$contextChunks = _ref.contextChunks,
|
|
55661
|
-
contextChunks = _ref$contextChunks === void 0 ?
|
|
55665
|
+
contextChunks = _ref$contextChunks === void 0 ? 30 : _ref$contextChunks,
|
|
55662
55666
|
mihelpAgentRef = _ref.mihelpAgentRef;
|
|
55663
55667
|
|
|
55664
55668
|
var _useState = React.useState(false),
|
|
@@ -56070,7 +56074,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
56070
56074
|
});
|
|
56071
56075
|
};
|
|
56072
56076
|
|
|
56073
|
-
var getSystemPrompt = function getSystemPrompt() {
|
|
56077
|
+
var getSystemPrompt = function getSystemPrompt(prompt) {
|
|
56074
56078
|
var context = {};
|
|
56075
56079
|
|
|
56076
56080
|
try {
|
|
@@ -56081,7 +56085,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
56081
56085
|
console.log('App context error');
|
|
56082
56086
|
}
|
|
56083
56087
|
|
|
56084
|
-
return frontEndUtils.string.substitute(
|
|
56088
|
+
return frontEndUtils.string.substitute(prompt, {
|
|
56085
56089
|
appContext: JSON.stringify(context)
|
|
56086
56090
|
});
|
|
56087
56091
|
};
|
|
@@ -56129,9 +56133,16 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
56129
56133
|
if (!newMessages.find(function (m) {
|
|
56130
56134
|
return (m === null || m === void 0 ? void 0 : m.role) === 'system';
|
|
56131
56135
|
})) {
|
|
56136
|
+
if (contextChangePrompt) {
|
|
56137
|
+
newMessages.unshift({
|
|
56138
|
+
role: 'system',
|
|
56139
|
+
content: getSystemPrompt(contextChangePrompt)
|
|
56140
|
+
});
|
|
56141
|
+
}
|
|
56142
|
+
|
|
56132
56143
|
newMessages.unshift({
|
|
56133
56144
|
role: 'system',
|
|
56134
|
-
content: getSystemPrompt()
|
|
56145
|
+
content: getSystemPrompt(systemPrompt)
|
|
56135
56146
|
});
|
|
56136
56147
|
}
|
|
56137
56148
|
|
|
@@ -56142,8 +56153,15 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
56142
56153
|
setCurrentContext(storage$1.appContext);
|
|
56143
56154
|
newMessages.splice(newMessages.length - 1, 0, {
|
|
56144
56155
|
role: 'system',
|
|
56145
|
-
content: getSystemPrompt()
|
|
56156
|
+
content: getSystemPrompt(systemPrompt)
|
|
56146
56157
|
});
|
|
56158
|
+
|
|
56159
|
+
if (contextChangePrompt) {
|
|
56160
|
+
newMessages.splice(newMessages.length - 1, 0, {
|
|
56161
|
+
role: 'system',
|
|
56162
|
+
content: getSystemPrompt(contextChangePrompt)
|
|
56163
|
+
});
|
|
56164
|
+
}
|
|
56147
56165
|
}
|
|
56148
56166
|
}
|
|
56149
56167
|
|
|
@@ -56159,6 +56177,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
56159
56177
|
last_n: contextMessagesCount,
|
|
56160
56178
|
app_name: currentAppName,
|
|
56161
56179
|
k: contextChunks,
|
|
56180
|
+
top_n: contextTopMessagesCount,
|
|
56162
56181
|
user_email: storage$1.userEmail
|
|
56163
56182
|
};
|
|
56164
56183
|
endpoint = (_storage$getLocalItem = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.mihelpChat;
|
|
@@ -56789,7 +56808,7 @@ var SCROLL = {
|
|
|
56789
56808
|
var NO_SCROLL = {};
|
|
56790
56809
|
var defaultSystemPrompt = 'Format all of the subsequent AI responses in valid HTML5, without markdown code blocks or any additional formatting, ensuring that the response consists only of raw HTML tags. Format your response in this structure:<html> <p> Your answer here </p> </html>';
|
|
56791
56810
|
var AppFrame = function AppFrame(props) {
|
|
56792
|
-
var _props$mihelpAgentPro, _props$mihelpAgentPro2, _props$mihelpAgentPro3, _props$mihelpAgentPro4, _props$mihelpAgentPro5, _props$mihelpAgentPro6;
|
|
56811
|
+
var _props$mihelpAgentPro, _props$mihelpAgentPro2, _props$mihelpAgentPro3, _props$mihelpAgentPro4, _props$mihelpAgentPro5, _props$mihelpAgentPro6, _props$mihelpAgentPro7, _props$mihelpAgentPro8;
|
|
56793
56812
|
|
|
56794
56813
|
// Check if the child AppBar is mounted
|
|
56795
56814
|
var _useState = React.useState(false),
|
|
@@ -56899,9 +56918,11 @@ var AppFrame = function AppFrame(props) {
|
|
|
56899
56918
|
quickReplies: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro = props.mihelpAgentProps) === null || _props$mihelpAgentPro === void 0 ? void 0 : _props$mihelpAgentPro.quickReplies,
|
|
56900
56919
|
collection: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro2 = props.mihelpAgentProps) === null || _props$mihelpAgentPro2 === void 0 ? void 0 : _props$mihelpAgentPro2.collection,
|
|
56901
56920
|
systemPrompt: (props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro3 = props.mihelpAgentProps) === null || _props$mihelpAgentPro3 === void 0 ? void 0 : _props$mihelpAgentPro3.systemPrompt) || defaultSystemPrompt,
|
|
56902
|
-
|
|
56903
|
-
|
|
56904
|
-
|
|
56921
|
+
contextChangePrompt: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro4 = props.mihelpAgentProps) === null || _props$mihelpAgentPro4 === void 0 ? void 0 : _props$mihelpAgentPro4.contextChangePrompt,
|
|
56922
|
+
contextMessagesCount: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro5 = props.mihelpAgentProps) === null || _props$mihelpAgentPro5 === void 0 ? void 0 : _props$mihelpAgentPro5.contextMessagesCount,
|
|
56923
|
+
contextTopMessagesCount: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro6 = props.mihelpAgentProps) === null || _props$mihelpAgentPro6 === void 0 ? void 0 : _props$mihelpAgentPro6.contextTopMessagesCount,
|
|
56924
|
+
contextChunks: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro7 = props.mihelpAgentProps) === null || _props$mihelpAgentPro7 === void 0 ? void 0 : _props$mihelpAgentPro7.contextChunksCount,
|
|
56925
|
+
mihelpAgentRef: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro8 = props.mihelpAgentProps) === null || _props$mihelpAgentPro8 === void 0 ? void 0 : _props$mihelpAgentPro8.mihelpAgentRef
|
|
56905
56926
|
})))));
|
|
56906
56927
|
};
|
|
56907
56928
|
AppFrame.defaultProps = {
|