@docyrus/ui-pro-ai-assistant 0.5.1 → 0.5.2
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/docy-assistant.d.ts +1 -1
- package/dist/index.js +19 -3
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +7 -0
- package/package.json +1 -1
package/dist/docy-assistant.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
import { type DocyAssistantProps } from './types';
|
|
3
|
-
export declare const DocyAssistant: ({ ref, isOpen, onClose, supportWebSearch, supportThinking, supportFiles, supportDocumentSearch, supportDeepResearch, supportMultiModels, supportWorkCanvas, apiEndpoint, title: titleProp, description: descriptionProp, placeholder: placeholderProp, logo, footerText: footerTextProp, variant, renderMode, enableSidebar, enableNavDropdown, enableVoice, enableMicrophone, enableWelcomePage, tenantAiAgentId, onMessageSend, onVoiceStart, onVoiceEnd, className, defaultFullscreen, hideExpand, hideCloseButton, hideAgentSelector, hideBorder, showHeader, hideHeaderOnWelcome, agentSelectorUrl, baseAgentSelectorUrl, onAgentChange, enableSharing, onShare: onShareProp, initialPrompt, initialModelId, initialFeatures, initialFiles, ...props }: DocyAssistantProps & {
|
|
3
|
+
export declare const DocyAssistant: ({ ref, isOpen, onClose, supportWebSearch, supportThinking, supportFiles, supportDocumentSearch, supportDeepResearch, supportMultiModels, supportWorkCanvas, apiEndpoint, title: titleProp, description: descriptionProp, placeholder: placeholderProp, logo, footerText: footerTextProp, variant, renderMode, enableSidebar, enableNavDropdown, enableVoice, enableMicrophone, enableWelcomePage, tenantAiAgentId, onMessageSend, onVoiceStart, onVoiceEnd, className, defaultFullscreen, hideExpand, hideCloseButton, hideAgentSelector, hideBorder, showHeader, hideHeaderOnWelcome, agentSelectorUrl, baseAgentSelectorUrl, onAgentChange, enableSharing, onShare: onShareProp, initialPrompt, initialModelId, initialFeatures, initialFiles, environment, ...props }: DocyAssistantProps & {
|
|
4
4
|
ref?: RefObject<HTMLDivElement | null>;
|
|
5
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -29515,7 +29515,20 @@ function CanvasTextView({
|
|
|
29515
29515
|
}
|
|
29516
29516
|
return /* @__PURE__ */ jsx("div", { className: "h-full w-full overflow-x-auto", children: /* @__PURE__ */ jsx(CanvasCodeView, { contentText, language, title }) });
|
|
29517
29517
|
}
|
|
29518
|
+
var stripUploadTagsFromText = (text) => text.replace(/<first_lines_of_csv_file>[\s\S]*?<\/first_lines_of_csv_file>/g, "").replace(/<attached_files>[\s\S]*?<\/attached_files>/g, "").replace(/<docx_file_content[^>]*>[\s\S]*?<\/docx_file_content>/g, "");
|
|
29518
29519
|
var AssistantView = ({ ref, ...props }) => {
|
|
29520
|
+
const filteredMessages = useMemo(() => (props.messages ?? []).map((message) => {
|
|
29521
|
+
if (message?.role !== "user" || !Array.isArray(message.parts)) return message;
|
|
29522
|
+
return {
|
|
29523
|
+
...message,
|
|
29524
|
+
parts: message.parts.map((part) => {
|
|
29525
|
+
if (part?.type === "text" && typeof part.text === "string") {
|
|
29526
|
+
return { ...part, text: stripUploadTagsFromText(part.text) };
|
|
29527
|
+
}
|
|
29528
|
+
return part;
|
|
29529
|
+
})
|
|
29530
|
+
};
|
|
29531
|
+
}), [props.messages]);
|
|
29519
29532
|
const [canvasWork, setCanvasWork] = useState(null);
|
|
29520
29533
|
const [canvasVersions, setCanvasVersions] = useState([]);
|
|
29521
29534
|
const [canvasVersionsLoading, setCanvasVersionsLoading] = useState(false);
|
|
@@ -29765,7 +29778,7 @@ var AssistantView = ({ ref, ...props }) => {
|
|
|
29765
29778
|
return /* @__PURE__ */ jsx(
|
|
29766
29779
|
ChatPanel,
|
|
29767
29780
|
{
|
|
29768
|
-
messages:
|
|
29781
|
+
messages: filteredMessages,
|
|
29769
29782
|
isLoading: commonProps2.isLoading,
|
|
29770
29783
|
input: commonProps2.input,
|
|
29771
29784
|
onInputChange: commonProps2.onInputChange,
|
|
@@ -30223,7 +30236,7 @@ var AssistantView = ({ ref, ...props }) => {
|
|
|
30223
30236
|
/* @__PURE__ */ jsx(
|
|
30224
30237
|
ChatPanel,
|
|
30225
30238
|
{
|
|
30226
|
-
messages:
|
|
30239
|
+
messages: filteredMessages,
|
|
30227
30240
|
isLoading: commonProps.isLoading,
|
|
30228
30241
|
input: commonProps.input,
|
|
30229
30242
|
onInputChange: commonProps.onInputChange,
|
|
@@ -31600,6 +31613,7 @@ var DocyAssistant = ({
|
|
|
31600
31613
|
initialModelId,
|
|
31601
31614
|
initialFeatures,
|
|
31602
31615
|
initialFiles,
|
|
31616
|
+
environment,
|
|
31603
31617
|
...props
|
|
31604
31618
|
}) => {
|
|
31605
31619
|
const config3 = useAssistantConfig();
|
|
@@ -31677,6 +31691,7 @@ var DocyAssistant = ({
|
|
|
31677
31691
|
supportDocumentSearch: options3?.supportDocumentSearch,
|
|
31678
31692
|
supportThinking: options3?.supportThinking,
|
|
31679
31693
|
supportWorkCanvas: options3?.supportWorkCanvas,
|
|
31694
|
+
...environment ? { environment } : {},
|
|
31680
31695
|
...options3?.filePaths?.length ? { files: options3.filePaths } : {}
|
|
31681
31696
|
}
|
|
31682
31697
|
};
|
|
@@ -31696,7 +31711,8 @@ var DocyAssistant = ({
|
|
|
31696
31711
|
baseUrl,
|
|
31697
31712
|
apiEndpoint,
|
|
31698
31713
|
activeAgentId,
|
|
31699
|
-
deploymentId
|
|
31714
|
+
deploymentId,
|
|
31715
|
+
environment
|
|
31700
31716
|
]);
|
|
31701
31717
|
const {
|
|
31702
31718
|
messages = [],
|